Skip to content

Instantly share code, notes, and snippets.

@klette
Created February 24, 2011 10:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klette/842032 to your computer and use it in GitHub Desktop.
Save klette/842032 to your computer and use it in GitHub Desktop.
vnstati updater
<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>
#!/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