Linux VPS installs vnStat for traffic monitoring

Linux VPS installs vnStat for traffic monitoring

Debian 7 32-bit installation is successful:

one,
1. Install vnStat 1.10

 wget https://zhujiwiki.com/wp-content/uploads/2016/11/vnstat-1.10.tar.gz tar xvzf vnstat-1.10.tar.gz cd vnstat-1.10 make make install

2. Install vnStat 1.15

 wget https://zhujiwiki.com/wp-content/uploads/2016/11/vnstat-1.15.tar.gz tar xvzf vnstat-1.15.tar.gz cd vnstat-1.15 ./configure --prefix=/usr --sysconfdir=/etc && make make install

2. Establish statistical data
1. Generate data (check the network card through ifconfig or ip addr. If the network card is not etho, modify the /etc/vnstat.conf file)

 /usr/bin/vnstat -u -i eth0

or

 vnstat -u -i eth0

2. Create a new vnstat file

 vi /etc/cron.d/vnstat

Manually add the following code:

 0-55/5 * * * * root vnstat -u -i eth0 0-55/5 * * * * root vnstat --dumpdb -i eth0 >/var/lib/vnstat/vnstat_dump_eth0

3. View statistics using PHP

Enter the website directory, such as /home/wwwroot/zhujiwiki.com
Install vnstat1.4

 wget https://zhujiwiki.com/wp-content/uploads/2016/07/362406408.zip unzip 362406408.zip

Install vnstat1.5.2

 wget https://zhujiwiki.com/wp-content/uploads/2016/12/2212366636.zip unzip 2212366636.zip

Then check the traffic through domain name/vnstat.

4. View the current real-time traffic under the command line

 vnstat -l

View daily traffic statistics

 vnstat -d

View monthly traffic statistics

 vnstat -m

View traffic reports

 vnstat

View the real-time traffic of a specific network card

 vnstat -l -i eth0

In addition, the amount of traffic used has little to do with the bandwidth you use.

5. Uninstall vnstat
Enter the vnstat directory

 make uninstall

Official website: https://github.com/vergoh/vnstat/

<<:  BudgetVM: 5% off dedicated servers

>>:  HostMyBytes: $20/year/512MB/25GB space/1000GB traffic/KVM/Los Angeles

Recommend

Recommended LINUX VPS panel: LLsMP, and install and use

1. Introduction to LLsMP It takes up little resou...

vMbox: $3.99/month/2 cores/1G/25G/3T/1 IP/OpenVZ/free SSL

VMBox is an American hosting company established ...

BitronicTech: $4.99/month/1GB RAM/20GB storage/1000GB bandwidth/Xen

BitronicTech is an American hosting company found...

IndoVirtue: $55/month/E3-1230v2/8GB RAM/2TB HDD/Unlimited traffic/Singapore

ndoVirtue, founded in late 2010, provides Singapo...

Use AliDDNS to deploy fixed domain names for dynamic IP VPS/NAT VPS

AliDDNS tool is a DDNS domain name update tool ba...