Created
February 24, 2011 10:34
-
-
Save klette/842032 to your computer and use it in GitHub Desktop.
vnstati updater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | |
<script src="jquery.masonry.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
$('body').masonry({ | |
itemSelector: 'img', | |
columnWidth: 500, | |
}); | |
}); | |
</script> | |
<meta http-equiv="refresh" content="60" /> | |
</head> | |
<body style="width: 1000px"> | |
<?php | |
list($dwidth, $dheight, $type, $attr) = getimagesize("vnstat-daily.png"); | |
list($hwidth, $hheight, $type, $attr) = getimagesize("vnstat-hourly.png"); | |
list($swidth, $sheight, $type, $attr) = getimagesize("vnstat-summary.png"); | |
list($mwidth, $mheight, $type, $attr) = getimagesize("vnstat-monthly.png"); | |
list($twidth, $theight, $type, $attr) = getimagesize("vnstat-top10.png"); | |
echo " | |
<img width='$dwidth' height='$dheight' src='vnstat-daily.png' /> | |
<img width='$hwidth' height='$hheight' src='vnstat-hourly.png' /> | |
<img width='$mwidth' height='$mheight' src='vnstat-monthly.png' /> | |
<img width='$swidth' height='$sheight' src='vnstat-summary.png' /> | |
<img width='$twidth' height='$theight' src='vnstat-top10.png' /> | |
"; | |
?> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vnstati -vs --config /etc/vnstat.conf -o vnstat-summary.png | |
vnstati -d --config /etc/vnstat.conf -o vnstat-daily.png | |
vnstati -m --config /etc/vnstat.conf -o vnstat-monthly.png | |
vnstati -h --config /etc/vnstat.conf -o vnstat-hourly.png | |
vnstati -t --config /etc/vnstat.conf -o vnstat-top10.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment