Page 1 of 1

Netstat

Posted: Wednesday 07 June 2017 16:37
by Macko
Hi,

Is there some way to display netstat or vnstat data in Domoticz?
I would like to monitor my network traffic from my Raspberry.

Macko

Re: Netstat

Posted: Monday 24 July 2017 15:49
by Collins1990
This is what I`ve found. Maybe this would help you:
Once the text database(s) have been initialised you're ready to monitor your bandwidth usage. The package installs a cronjob which will update the database every five minutes.

Once you've left the system alone for a while to quietly collect the data you can view it using one of the reporting modes. The most simple way of doing so is to just invoke the command with no arguments:

skx@lappy:~$ vnstat
Database updated: Thu Jan 12 12:35:01 2006

eth0

received: 76.17 MB (87.4%)
transmitted: 11.72 MB (12.6%)
total: 87.90 MB

rx | tx | total
-----------------------+------------+-----------
yesterday 53.66 MB | 7.69 MB | 61.36 MB
today 22.50 MB | 4.03 MB | 26.54 MB
-----------------------+------------+-----------
estimated 41 MB | 7 MB | 48 MB

There are several different ways of viewing the bandwidth usage as we suggested earlier. These are invoked via command line arguments such as --hours, --days, etc.

This is an hourly view:

eth0 12:35
^ t
| t
| t
| t t t
| t t t t t t
| t t t t t t t t
| t t t t t t t t t t t t t
| t t t t t t t t t t t t t t t t t t
| t t t t t t t t t t t t t t t t t t t t t t t t
| rt rt rt t t t t rt t t t t t t t t t t t t t t t t
-+--------------------------------------------------------------------------->
| 13 14 15 16 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12

vnstat is a useful tool for showing you the total transmitted and received network data. One drawback is that it won't show you what has been sending or receiving data - just the count of data sent. If you're looking to view more advanced network statistics you'll probably wish to use something like ntop instead.

For more details of the available output modes please see the vnstat manpage which you can read by running: