-
-
Save koheyamada/0d12a719b526917b6f02 to your computer and use it in GitHub Desktop.
vnstatで手軽にtrafiicをモニタリング ref: http://qiita.com/kooohei/items/d4b29be4541cec5018c6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstat -u -i eth0 | |
Error: Unable to read database "/var/lib/vnstat/eth0". | |
Info: -> A new database has been created. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstat --help | |
vnStat 1.11 by Teemu Toivola <tst at iki dot fi> | |
-q, --query query database | |
-h, --hours show hours | |
-d, --days show days | |
-m, --months show months | |
-w, --weeks show weeks | |
-t, --top10 show top10 | |
-s, --short use short output | |
-u, --update update database | |
-i, --iface select interface (default: eth0) | |
-?, --help short help | |
-v, --version show version | |
-tr, --traffic calculate traffic | |
-ru, --rateunit swap configured rate unit | |
-l, --live show transfer rate in real time | |
See also "--longhelp" for complete options list and "man vnstat". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstat -w | |
eth0 / weekly | |
rx | tx | total | avg. rate | |
---------------------------+-------------+-------------+--------------- | |
last 7 days 25 KiB | 13 KiB | 38 KiB | 0.00 kbit/s | |
current week 25 KiB | 13 KiB | 38 KiB | 0.00 kbit/s | |
---------------------------+-------------+-------------+--------------- | |
estimated -- | -- | -- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo yum install --enablerepo=epel vnstat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install vnstat vnstati |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstati -vs -o ./hsum.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstat -u -i eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo service vnstat start | |
vnstatd を起動中: [ OK ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vnstat | |
Database updated: Tue Jul 7 15:16:40 2015 | |
eth0 since 07/07/15 | |
rx: 25 KiB tx: 13 KiB total: 38 KiB | |
monthly | |
rx | tx | total | avg. rate | |
------------------------+-------------+-------------+--------------- | |
Jul '15 25 KiB | 13 KiB | 38 KiB | 0.00 kbit/s | |
------------------------+-------------+-------------+--------------- | |
estimated -- | -- | -- | | |
daily | |
rx | tx | total | avg. rate | |
------------------------+-------------+-------------+--------------- | |
today 25 KiB | 13 KiB | 38 KiB | 0.01 kbit/s | |
------------------------+-------------+-------------+--------------- | |
estimated -- | -- | -- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls /var/lib/vnstat/ | |
eth0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment