{"id":104,"date":"2021-01-15T10:54:44","date_gmt":"2021-01-15T01:54:44","guid":{"rendered":"https:\/\/ubuntu.auctionpro.co.kr\/?page_id=104"},"modified":"2021-07-01T11:03:16","modified_gmt":"2021-07-01T02:03:16","slug":"traffic-monitor","status":"publish","type":"page","link":"https:\/\/ubuntu.auctionpro.co.kr\/?page_id=104","title":{"rendered":"Traffic monitor"},"content":{"rendered":"<h3>Remark :<\/h3>\n<p>Ubuntu install vnstat console network traffic monitor<\/p>\n<h3><\/h3>\n<h3>1. Install<\/h3>\n<pre class=\"lang:vim decode:true \">sudo apt-get install vnstat<\/pre>\n<h3>2. find out your interface name<\/h3>\n<pre class=\"lang:vim decode:true \">ip l show\r\nip a show\r\n<\/pre>\n<pre class=\"lang:vim decode:true \">$ ip l show\r\n1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\r\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000\r\n    link\/ether b7:27:eb:45:12:b3 brd ff:ff:ff:ff:ff:ff\r\n3: wlan0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc pfifo_fast state DOWN mode DORMANT group default qlen 1000\r\n    link\/ether b8:27:eb:10:47:e6 brd ff:ff:ff:ff:ff:ff\r\n\r\n$ ip a show\r\n1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\r\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n    inet 127.0.0.1\/8 scope host lo\r\n       valid_lft forever preferred_lft forever\r\n    inet6 ::1\/128 scope host\r\n       valid_lft forever preferred_lft forever\r\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\r\n    link\/ether b7:27:eb:45:12:b3 brd ff:ff:ff:ff:ff:ff\r\n    inet 192.168.1.128\/24 brd 192.168.1.255 scope global noprefixroute eth0\r\n       valid_lft forever preferred_lft forever\r\n    inet6 fe80::3527:7396:9dfe:6517\/64 scope link\r\n       valid_lft forever preferred_lft forever\r\n3: wlan0: &lt;NO-CARRIER,BROADCAST,MULTICAST,UP&gt; mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000\r\n    link\/ether b7:27:eb:10:47:e6 brd ff:ff:ff:ff:ff:ff\r\n<\/pre>\n<h3>3. Configuration<\/h3>\n<pre class=\"lang:vim decode:true \">sudo vi \/etc\/vnstat.conf<\/pre>\n<pre class=\"lang:vim decode:true \">Interface \"enp0s31f6\"  =&gt; Interface \"eth0\"\r\n\r\n<\/pre>\n<h3>4. A new database create \/ vnstat &#8211;create -i eth0<\/h3>\n<pre class=\"lang:vim decode:true \">$ vnstat --create -i eth0\r\n<\/pre>\n<pre class=\"lang:vim decode:true \">$ vnstat -d\r\nNo database found, nothing to do. Use --help for help.\r\n\r\nA new database can be created with the following command:\r\n    vnstat --create -i eth0\r\n\r\nReplace 'eth0' with the interface that should be monitored.\r\n\r\nThe following interfaces are currently available:\r\n    eth0 lo\r\n$ vnstat --create -i eth0\r\n<\/pre>\n<h3>5. Now, make vnstat daemon auto start at boot<\/h3>\n<pre class=\"lang:default decode:true \">sudo systemctl start vnstat.service\r\nsudo systemctl enable vnstat.service<\/pre>\n<h3>6. check \/ vnstat -h<\/h3>\n<pre class=\"lang:vim decode:true \">$ vnstat -h\r\n eth0                                                                     10:49\r\n  ^                                                                     t\r\n  |                                                                     t\r\n  |                                                                     t\r\n  |                                                                     t\r\n  |                                                                     t\r\n  |                                                                     t\r\n  |                                r                                    t  t\r\n  |                                r                                    t  t\r\n  |                             r  r  r  r  r                           t  t\r\n  |           rt r              r  r  r  r  r                          rt rt\r\n -+---------------------------------------------------------------------------&gt;\r\n  |  11 12 13 14 15 16 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10\r\n\r\n h  rx (KiB)   tx (KiB)  ][  h  rx (KiB)   tx (KiB)  ][  h  rx (KiB)   tx (KiB)\r\n11         18          5 ][ 19         23          3 ][ 03         32          3\r\n12         31          5 ][ 20        101          9 ][ 04         20          3\r\n13         27          4 ][ 21        230         17 ][ 05         28          3\r\n14         61         51 ][ 22        131         15 ][ 06         25          5\r\n15         48          7 ][ 23        106         15 ][ 07         44          6\r\n16         19          4 ][ 00        109         11 ][ 08         43         10\r\n17         21          4 ][ 01         25          3 ][ 09         90        470\r\n18         17          3 ][ 02         24          3 ][ 10         71        216\r\n<\/pre>\n<h3>issue: . Not enough data available yet.<\/h3>\n<pre class=\"lang:vim decode:true \">$ sudo chown vnstat:vnstat -R \/var\/lib\/vnstat\/*\r\n\r\n$ sudo chmod 777 -R \/var\/lib\/vnstat\/*<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Remark : Ubuntu install vnstat console network traffic monitor 1. Install sudo apt-get install vnstat 2. find out your interface name ip l show ip a show $ ip l show 1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 &hellip;<br \/><a href=\"https:\/\/ubuntu.auctionpro.co.kr\/?page_id=104\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\"><span class=\"screen-reader-text\">Traffic monitor<\/span> \ub354\ubcf4\uae30<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":13,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-104","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/104","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=104"}],"version-history":[{"count":9,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/104\/revisions"}],"predecessor-version":[{"id":109,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/104\/revisions\/109"}],"up":[{"embeddable":true,"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/13"}],"wp:attachment":[{"href":"https:\/\/ubuntu.auctionpro.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}