netdata / netdata

Architected for speed. Automated for easy. Monitoring and troubleshooting, transformed!
https://www.netdata.cloud
GNU General Public License v3.0
71.2k stars 5.88k forks source link

Vnstat support by Netdata #9304

Open startryst opened 4 years ago

startryst commented 4 years ago

This is same as #3756 , but would like to see any possibility to make it happen.

ilyam8 commented 4 years ago

Hi

https://linux.die.net/man/1/vnstat

vnStat is a console-based network traffic monitor. It keeps a log of hourly, daily and monthly network traffic for the selected interface(s). However, it isn't a packet sniffer. The traffic information is analyzed from the proc(5) and sys filesystems depending on availability. That way vnStat can be used even without root permissions on most systems.

I think we already collect network traffic from proc.

Can you elaborate a bit? I didnt read #3756 carefully, but since it is a new issue it would be nice to have more or less detailed description what you ask.

startryst commented 4 years ago

So, let me share this to you as the outcome what I'm trying say:

[root@xxx0 ~]# vnstat

                      rx      /      tx      /     total    /   estimated
 eth0:
       2020-05    275.98 GiB  /  276.91 GiB  /  552.89 GiB
       2020-06    105.04 GiB  /  105.22 GiB  /  210.26 GiB  /  670.58 GiB
     yesterday      9.74 GiB  /    9.75 GiB  /   19.50 GiB
         today      3.97 GiB  /    3.96 GiB  /    7.93 GiB  /   19.52 GiB

 hphk:
       2020-05      7.67 GiB  /    8.75 GiB  /   16.42 GiB
       2020-06      1.97 GiB  /    2.29 GiB  /    4.27 GiB  /   13.61 GiB
     yesterday    160.64 MiB  /  198.94 MiB  /  359.57 MiB
         today    101.41 MiB  /  130.93 MiB  /  232.34 MiB  /  571.90 MiB

[root@xxx0 ~]# vnstat -d

 eth0  /  daily

          day        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     2020-05-12    10.85 GiB |   10.90 GiB |   21.75 GiB |    2.16 Mbit/s
     2020-05-13    14.66 GiB |   14.71 GiB |   29.37 GiB |    2.92 Mbit/s
     2020-05-14     9.77 GiB |    9.71 GiB |   19.49 GiB |    1.94 Mbit/s
     2020-05-15    17.27 GiB |   17.24 GiB |   34.52 GiB |    3.43 Mbit/s
     2020-05-16     6.40 GiB |    6.44 GiB |   12.84 GiB |    1.28 Mbit/s
     2020-05-17     4.82 GiB |    4.79 GiB |    9.61 GiB |  955.02 kbit/s
     2020-05-18    10.18 GiB |   10.22 GiB |   20.40 GiB |    2.03 Mbit/s
     2020-05-19    12.44 GiB |   12.46 GiB |   24.90 GiB |    2.48 Mbit/s
     2020-05-20    10.71 GiB |   10.74 GiB |   21.45 GiB |    2.13 Mbit/s
     2020-05-21    12.17 GiB |   12.17 GiB |   24.33 GiB |    2.42 Mbit/s
     2020-05-22     8.36 GiB |    8.39 GiB |   16.75 GiB |    1.67 Mbit/s
     2020-05-23     4.36 GiB |    4.42 GiB |    8.79 GiB |  873.47 kbit/s
     2020-05-24     4.31 GiB |    4.36 GiB |    8.67 GiB |  861.82 kbit/s
     2020-05-25    16.04 GiB |   16.07 GiB |   32.11 GiB |    3.19 Mbit/s
     2020-05-26    10.42 GiB |   10.44 GiB |   20.86 GiB |    2.07 Mbit/s
     2020-05-27    13.63 GiB |   13.68 GiB |   27.30 GiB |    2.71 Mbit/s
     2020-05-28    13.53 GiB |   13.57 GiB |   27.10 GiB |    2.69 Mbit/s
     2020-05-29    17.17 GiB |   17.20 GiB |   34.36 GiB |    3.42 Mbit/s
     2020-05-30     5.24 GiB |    5.27 GiB |   10.51 GiB |    1.05 Mbit/s
     2020-05-31     4.08 GiB |    4.07 GiB |    8.15 GiB |  810.18 kbit/s
     2020-06-01     9.90 GiB |    9.95 GiB |   19.86 GiB |    1.97 Mbit/s
     2020-06-02    15.03 GiB |   15.01 GiB |   30.05 GiB |    2.99 Mbit/s
     2020-06-03    11.98 GiB |   11.94 GiB |   23.92 GiB |    2.38 Mbit/s
     2020-06-04    13.55 GiB |   13.56 GiB |   27.10 GiB |    2.69 Mbit/s
     2020-06-05    15.70 GiB |   15.73 GiB |   31.43 GiB |    3.13 Mbit/s
     2020-06-06     5.52 GiB |    5.56 GiB |   11.08 GiB |    1.10 Mbit/s
     2020-06-07     3.64 GiB |    3.69 GiB |    7.32 GiB |  728.16 kbit/s
     2020-06-08    16.00 GiB |   16.06 GiB |   32.07 GiB |    3.19 Mbit/s
     2020-06-09     9.74 GiB |    9.75 GiB |   19.50 GiB |    1.94 Mbit/s
     2020-06-10     4.06 GiB |    4.05 GiB |    8.11 GiB |    1.97 Mbit/s
     ------------------------+-------------+-------------+---------------
     estimated      9.92 GiB |    9.88 GiB |   19.80 GiB |

image

So as you see above, through vnstat, we can get a aggregate of how many bytes has been transferred, rather than the real-time one, would be nice if we can get similar output from netdata.

ndt8552 commented 4 years ago

Is there any update on this? My company uses vnstat and this will be very useful to us.

ilyam8 commented 4 years ago

@ndt8552 there is a pr with the plugin

https://github.com/netdata/netdata/pull/8955

You can test it, would be nice