vergoh / vnstat

vnStat - a network traffic monitor for Linux and BSD
GNU General Public License v2.0
1.41k stars 120 forks source link

How to poll for traffic usage every minute or cetain seconds? #209

Closed SisyphusIsntHappy closed 2 years ago

SisyphusIsntHappy commented 3 years ago

I see that vnstat can save for traffic usage to disk as frequently as five minutes. Say I'm transferring data a very high speeds, and I live a location prone to blackouts, in this case I'll loose the traffic data if there is a black out just before vnstat polls for traffic usage.

So my question is where in the source code I can tweak so that vnstat can be made to poll at arbitrary intervals?

vergoh commented 3 years ago

No need to modify the source code as it's pretty much all configurable in the config file. See the "DAEMON RELATED KEYWORDS" section from https://humdi.net/vnstat/man/vnstat.conf.html or man vnstat.conf.

SaveInterval is the primary configuration option for changing how often data is written to disk. PollInterval in turn sets how often data gets polled and then cached internally.