Re: Total bytes per IP for accounting on ntopng

Emanuele Faranda <[email protected]>
Newsgroups gmane.linux.ntop.general
Organization ntop
Message-ID <[email protected]>
Hi,

Currently ntopng does not export such daily information via an API. Feel 
free to open a feature request on github https://github.com/ntop/ntopng 
for an API request.

As an alternative, if you have MySQL support enabled (see -F option), 
you could perform manual MySQL aggregations from the database.

Another alternative is to read data from the RRD files which ntopng 
creates every 5 minute for local hosts (see -m option for defining local 
networks). In this case, you could read the statistics of the host 
192.168.1.1 with the command "rrdtool fetch 
/var/tmp/ntopng/0/rrd/192/168/1/1/bytes.rrd AVERAGE -s now-1d". The 
first column of the output contains the downloaded host traffic, while 
the second the uploaded traffic.

This approach has the following implications:

- data is actually an average of the host traffic in 5 minutes, not the 
actual traffic

- data is not aggregated, you will need to sum up the rows values to get 
the total

- you will need to multiply the row value by 300, since values are derivates

See https://oss.oetiker.ch/rrdtool/doc/rrdtool.en.html for more details.

Regards,
Emanuele


On 05/07/2017 01:21 PM, Umut Arus wrote:
> Hi,
>
> I'd like to collect of clients downloaded data per IP every day so 
> I'll integrate it for home made quota management per IP.
>
> How can I get the data of total bytes from an API or cli from ntopng?
>
> thanks.
>
> -- 
> *Umut Arus*
> *
> *
> Information Technology
> Sabancı University
>
>
>
>
> _______________________________________________
> Ntop mailing list
> [email protected]
> http://listgateway.unipi.it/mailman/listinfo/ntop

_______________________________________________
Ntop mailing list
[email protected]
http://listgateway.unipi.it/mailman/listinfo/ntop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.