» vnstat on openSUSE
vnstat
is a network traffic monitor that collects the amount of data you transmit over network interfaces (typically, your Internet uplink), and can display them- on a terminal:
- or, since version 1.7, also as graphs:
vnstat
runs through a cron
job at a regular interval (every 5 minutes by default) and collects network transfer statistics for selected network interfaces, to be able to give you information about daily, weekly, monthly traffic.
To install and run vnstat
on openSUSE, either use the 1-click install for openSUSE 11.1, openSUSE 11.0 or SLE 11, or proceed as follows:
# add the "server:monitoring" repository if needed:
zypper ar -r http://download.opensuse.org/repositories/\ server:/monitoring/openSUSE_11.1/server:monitoring.repo # (optionally adapt the URL above to match your distribution, # e.g. openSUSE_11.0 or SLE_11 instead of openSUSE_11.1) # download and refresh the repository metadata: zypper refresh # install the vnstat and vnstat-cgi packages: zypper install vnstat vnstat-cgi
That being done, simply run the following command as root to create a zypper ar -r http://download.opensuse.org/repositories/\ server:/monitoring/openSUSE_11.1/server:monitoring.repo # (optionally adapt the URL above to match your distribution, # e.g. openSUSE_11.0 or SLE_11 instead of openSUSE_11.1) # download and refresh the repository metadata: zypper refresh # install the vnstat and vnstat-cgi packages: zypper install vnstat vnstat-cgi
vnstat
database for at least one of your network interfaces, obviously using whatever connection you want to collect statistics for instead of "eth0"
:
vnstat-create-db eth0
And we're already finished :)
To see the results, give vnstat
a few minutes to collect data (at least 5 minutes), and either see the results in a terminal:
vnstat
vnstat -h
Or point your favourite webbrowser at the following URL: http://localhost/vnstat
Note: if the URL above doesn't work, make sure to start vnstat -h
apache2
first, using the following command as root:rcapache2 start
4 Comments:
Does `vnstat' open own web server on `localhost'? Which services is in RAM for it?
Looks very nice. Thanks for the tip.
Unfortunately I get the following error, when running the vnstat-create-db script:
/usr/bin/vnstat-create-db: vnstat-create-db: line 53: syntax error: unexpected end of file
@Oliver: fixed now, just update.
@DimiG: no, it's a CGI that runs in Apache ("rcapache2 start" to start it if needed, I forgot to mention that :)), but I also added the necessary Apache configuration in the vnstat-cgi package
Cool. Bug with permissions on /var/lib/vnstat was solved during I was writing bugreport.
It is very quick )
Post a Comment
<< Home