blob: 98f78918914ef228c26c2f2ee51bd43aed5c3793 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
vnstat (a console-based network traffic monitor)
vnStat is a network traffic monitor for Linux that keeps a log of daily
network traffic for the selected interface(s). vnStat isn't a packet
sniffer. The traffic information is analyzed from the /proc filesystem,
so vnStat can be used without root permissions.
This program is open source (GPL) and can be installed in 'single' and
'root' mode.
Note that you can run vnstat either from cron or as a daemon from
/etc/rc.d.
To run vnstat from cron, add the following line to your crontab:
0-55/5 * * * * if [[ -x /usr/bin/vnstat && $(ls /var/lib/vnstat/ | wc -l) -ge 1 ]]; then /usr/bin/vnstat -u; fi
To run vnstat from /etc/rc.d:
chmod +x /etc/rc.d/rc.vnstat
Note that to have vnstat start automatically this way it should be
called from rc.local (and optionally rc.local_shutdown) like so:
In rc.local:
# Start vnstat
if [ -x /etc/rc.d/rc.vnstat ]; then
/etc/rc.d/rc.vnstat start
fi
In rc.local_shutdown:
# Stop vnstat
if [ -x /etc/rc.d/rc.vnstat ]; then
/etc/rc.d/rc.vnstat stop
fi
|