Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed vnstat and now I would like to have statistics in my browser like this:

enter image description here

You can see working script here. Where can I get that cgidemo script?

Source: http://humdi.net/vnstat/

share|improve this question
add comment

2 Answers

You make the images with the command vnstati. From the link:

Description

The purpose of vnstati is to provide image output support for statistics collected using vnstat(1). The image file format is limited to png. All basic outputs of vnStat are supported excluding live traffic features. The image can be outputted either to a file or to standard output.

Synopsis

vnstati [ -cdhimostv? ] [ --cache time ] [ --config file ] [ --days ] [ --dbdir directory ] 
[ --help ] [ --hours ] [ -hs ] [ --hsummary ] [ -i interface ] [ --iface interface ] 
[ --locale locale ] [ --months ] [ -ne ] [ -nh ] [ --noedge ] [ --noheader ] 
[ --output file ] [ -ru ] [ --rateunit ] [ --style number ] [ --summary ] 
[ --top10 ] [ --transparent ] [ --version ] [ -vs ] [ --vsummary ]

Examples

vnstati -s -i eth0 -o /tmp/vnstat.png

Output traffic summary for interface eth0 to file /tmp/vnstat.png.

vnstati -vs -i eth0+eth1+eth2 -o /tmp/vnstat.png

Output traffic summary with hourly data under the normal summary for a merge of interfaces eth0, eth1 and eth2 to file /tmp/vnstat.png.

vnstati -h -c 15 -o /tmp/vnstat_h.png

Output hourly traffic statistics for default interface to file /tmp/vnstat_h.png if the file has not been updated within the last 15 minutes.

vnstati -d -ne -nh -o -

Output daily traffic statistics without displaying the header section and edges for default interface to standard output (stdout).

vnstati -m --config /home/me/vnstat.cfg -i -o -

Output monthly traffic statistics for default interface specified in configuration file /home/me/vnstat.cfg to standard output (stdout).

share|improve this answer
add comment

Rinzwind is right, vnstati generates images. But there is a script also which is written in Perl and uses vnstati. I have found that script after downloading source code of vnstat from here. It is called vnstat.cgi and is located under the folder called examples. You need just configure webserver to run cgi and it outputs the same images as in http://humdi.net/vnstat/cgidemo/ page.

share|improve this answer
    
Excellent.Did not think to download the source :( ah well :D –  Rinzwind Feb 14 '12 at 10:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.