vnstatd.8 (vnstat-2.8) | : | vnstatd.8 (vnstat-2.9) | ||
---|---|---|---|---|
VNSTATD(8) User Manuals VNSTATD(8) | VNSTATD(8) User Manuals VNSTATD(8) | |||
NAME | NAME | |||
vnstatd - daemon based database updating for vnStat | vnstatd - daemon based database updating for vnStat | |||
SYNOPSIS | SYNOPSIS | |||
vnstatd [-Ddnpsv?] [--alwaysadd [mode]] [--config file] [--daemon] [--de | vnstatd [-Ddnpstv?] [--alwaysadd [mode]] [--config file] [--daemon | |||
bug] [-g group] [--group group] | ] [--debug] [-g group] [--group | |||
[--help] [--initdb] [--noadd] [--nodaemon] [--pidfile file] [--sync] [--u | group] [--help] [--initdb] [--noadd] [--nodaemon] [--pidfile file] [--sy | |||
user] [--user user] [--ver- | nc] [--timestamp] [--u user] | |||
sion] | [--user user] [--version] | |||
DESCRIPTION | DESCRIPTION | |||
The purpose of vnstatd is to provide a flexible and robust way for updat ing the database that vnstat(1) | The purpose of vnstatd is to provide a flexible and robust way for updat ing the database that vnstat(1) | |||
uses. The availability of each interface is automatically tracked which r emoves the need for additional | uses. The availability of each interface is automatically tracked which r emoves the need for additional | |||
scripts to be implemented and called when an interface comes online or go es offline. | scripts to be implemented and called when an interface comes online or go es offline. | |||
vnstatd is the command for starting the daemon. The daemon can either for k itself to run as a background | vnstatd is the command for starting the daemon. The daemon can either for k itself to run as a background | |||
process or stay attached to the terminal. It supports logging to a user | process or stay attached to the terminal. It supports logging direc | |||
selectable file or using sys- | tly to terminal, to a user | |||
log. | selectable file or using syslog. | |||
Once started, the daemon will read vnstat.conf(5) if available and th en check if there is a database | Once started, the daemon will read vnstat.conf(5) if available and th en check if there is a database | |||
present in the database directory that has been specified in the configur ation file. By default, if no | present in the database directory that has been specified in the configur ation file. By default, if no | |||
database is found, a database will be created during startup with entri es for all available interfaces | database is found, a database will be created during startup with entri es for all available interfaces | |||
excluding pseudo interfaces lo, lo0 and sit0. This automatic database ent ry creation behaviour can be | excluding pseudo interfaces lo, lo0 and sit0. This automatic database ent ry creation behaviour can be | |||
disabled using the --noadd option. Alternatively, using the --alwaysadd option instructs the daemon to | disabled using the --noadd option. Alternatively, using the --alwaysadd option instructs the daemon to | |||
create new database entries whenever interfaces not currently in the data bases become visible. | create new database entries whenever interfaces not currently in the data bases become visible. | |||
The daemon will proceed to track the availability of monitored interfaces , process the interface traffic | The daemon will proceed to track the availability of monitored interfaces , process the interface traffic | |||
statistics and write new values to the database at a configured interva l. As a result, the daemon ends | statistics and write new values to the database at a configured interva l. As a result, the daemon ends | |||
skipping to change at line 92 | skipping to change at line 92 | |||
-n, --nodaemon. | -n, --nodaemon. | |||
-s, --sync | -s, --sync | |||
Synchronize internal counters in the database with interface co unters for all available inter- | Synchronize internal counters in the database with interface co unters for all available inter- | |||
faces before starting traffic monitoring. Use this option if the traffic between the previous | faces before starting traffic monitoring. Use this option if the traffic between the previous | |||
shutdown and the current startup of the daemon needs to be ignored . This option isn't required in | shutdown and the current startup of the daemon needs to be ignored . This option isn't required in | |||
normal use because the daemon will automatically synchronize the i nternal counters after a system | normal use because the daemon will automatically synchronize the i nternal counters after a system | |||
reboot, if enough time has passed since the daemon was previo usly running or if the internal | reboot, if enough time has passed since the daemon was previo usly running or if the internal | |||
counters are clearly out of sync. | counters are clearly out of sync. | |||
-t, --timestamp | ||||
Add a timestamp to the beginning of every print from the daemon wh | ||||
en the process is running in | ||||
the foreground attached to a terminal after having been started wi | ||||
th the -n, --nodaemon option. | ||||
-u, --user user | -u, --user user | |||
Set daemon process user to user during startup. user can be eithe r the login of the user or a | Set daemon process user to user during startup. user can be ei ther the login of the user or a | |||
numerical user id. This option can only be used when the process i s started as root. | numerical user id. This option can only be used when the process i s started as root. | |||
-v, --version | -v, --version | |||
Show current version of the daemon executable. | Show current version of the daemon executable. | |||
-?, --help | -?, --help | |||
Show a command option summary. | Show a command option summary. | |||
CONFIGURATION | CONFIGURATION | |||
The behaviour of the daemon is configured mainly using the configu ration keywords UpdateInterval, | The behaviour of the daemon is configured mainly using the configura tion keywords UpdateInterval, | |||
PollInterval and SaveInterval in the configuration file. | PollInterval and SaveInterval in the configuration file. | |||
UpdateInterval defines in seconds how often the interface data is fetched | UpdateInterval defines in seconds how often the interface data is fetche | |||
and updated. This is similar | d and updated. This is similar | |||
to the run interval for alternative cron based updating. However, | to the run interval for alternative cron based updating. However, the | |||
the difference is that the data | difference is that the data | |||
doesn't directly get written to disk during updates. | doesn't directly get written to disk during updates. | |||
PollInterval defines in seconds how often the list of available interfa ces is checked for possible | PollInterval defines in seconds how often the list of available int erfaces is checked for possible | |||
changes. The minimum value is 2 seconds and the maximum 60 seconds. Poll Interval also defines the reso- | changes. The minimum value is 2 seconds and the maximum 60 seconds. Poll Interval also defines the reso- | |||
lution for other intervals. | lution for other intervals. | |||
SaveInterval defines in minutes how often cached interface data is writte n to disk. A write can only | SaveInterval defines in minutes how often cached interface data is wri tten to disk. A write can only | |||
occur during the updating of interface data. Therefore, the value should be a multiple of UpdateInterval | occur during the updating of interface data. Therefore, the value should be a multiple of UpdateInterval | |||
with a maximum value of 60 minutes. | with a maximum value of 60 minutes. | |||
The default values of UpdateInterval 30, SaveInterval 5 and PollInterval 5 are usually suitable for most | The default values of UpdateInterval 30, SaveInterval 5 and PollInterval 5 are usually suitable for most | |||
systems and provide a similar behaviour as cron based updating does b ut with a better resolution for | systems and provide a similar behaviour as cron based updating does but w ith a better resolution for | |||
interface changes and fast interfaces. | interface changes and fast interfaces. | |||
For embedded and/or low power systems more tuned configurations are possi | For embedded and/or low power systems more tuned configurations are | |||
ble. In such cases if the | possible. In such cases if the | |||
interfaces are mostly static the PollInterval can be increased to around | interfaces are mostly static the PollInterval can be increased to around | |||
10-30 seconds and UpdateInter- | 10-30 seconds and UpdateInter- | |||
val set to 60 seconds. Higher values up to 300 seconds are possible if th e interface speed is 10 Mbit or | val set to 60 seconds. Higher values up to 300 seconds are possible if th e interface speed is 10 Mbit or | |||
less. SaveInterval can be increased for example to 15, 30 or even 60 min utes depending on how often the | less. SaveInterval can be increased for example to 15, 30 or even 60 min utes depending on how often the | |||
data needs to be viewed. | data needs to be viewed. | |||
SIGNALS | SIGNALS | |||
The daemon is listening to signals SIGHUP, SIGINT and SIGTERM. Sending t | The daemon is listening to signals SIGHUP, SIGINT and SIGTERM. Sending | |||
he SIGHUP signal to the daemon | the SIGHUP signal to the daemon | |||
will cause cached data to be written to disk, a rescan of the database | will cause cached data to be written to disk, a rescan of the database di | |||
directory and a reload of set- | rectory and a reload of set- | |||
tings from the configuration file. However, the pid file location will no | tings from the configuration file. However, the pid file location will n | |||
t be changed even if it's con- | ot be changed even if it's con- | |||
figuration setting has been modified. | figuration setting has been modified. | |||
SIGTERM and SIGINT signals will cause the daemon to write all cached data to disk and then exit. | SIGTERM and SIGINT signals will cause the daemon to write all cached data to disk and then exit. | |||
FILES | FILES | |||
/var/lib/vnstat/ | /var/lib/vnstat/ | |||
Default database directory. | Default database directory. | |||
/etc/vnstat.conf | /etc/vnstat.conf | |||
Config file that will be used unless $HOME/.vnstatrc exists. Se e the configuration chapter and | Config file that will be used unless $HOME/.vnstatrc exists. See t he configuration chapter and | |||
vnstat.conf(5) for more information. | vnstat.conf(5) for more information. | |||
/var/log/vnstat/vnstat.log | /var/log/vnstat/vnstat.log | |||
Log file that will be used if logging to file is enable and no oth er file is specified in the | Log file that will be used if logging to file is enable and no other file is specified in the | |||
config file. | config file. | |||
/var/run/vnstat/vnstat.pid | /var/run/vnstat/vnstat.pid | |||
File used for storing the process id when running as a background process and if no other file is | File used for storing the process id when running as a background process and if no other file is | |||
specified in the configuration file or using the command line para meter. | specified in the configuration file or using the command line para meter. | |||
RESTRICTIONS | RESTRICTIONS | |||
Updates need to be executed at least as often as it is possible for the | Updates need to be executed at least as often as it is possible for t | |||
interface to generate enough | he interface to generate enough | |||
traffic to overflow the kernel interface traffic counter. Otherwise, i | traffic to overflow the kernel interface traffic counter. Otherwise, it i | |||
t is possible that some traffic | s possible that some traffic | |||
won't be seen. With 32-bit interface traffic counters, the maximum time b | won't be seen. With 32-bit interface traffic counters, the maximum time | |||
etween two updates depends on | between two updates depends on | |||
how fast the interface can transfer 4 GiB. Note that there is no gua | how fast the interface can transfer 4 GiB. Note that there is no guarant | |||
rantee that a 64-bit kernel has | ee that a 64-bit kernel has | |||
64-bit interface traffic counters for all interfaces. Calculated theoreti cal times are: | 64-bit interface traffic counters for all interfaces. Calculated theoreti cal times are: | |||
10 Mbit: 54 minutes | 10 Mbit: 54 minutes | |||
100 Mbit: 5 minutes | 100 Mbit: 5 minutes | |||
1000 Mbit: 30 seconds | 1000 Mbit: 30 seconds | |||
Virtual and aliased interfaces cannot be monitored because the kernel doe | Virtual and aliased interfaces cannot be monitored because the kernel d | |||
sn't provide traffic informa- | oesn't provide traffic informa- | |||
tion for that type of interfaces. Such interfaces are usually named et | tion for that type of interfaces. Such interfaces are usually named eth0: | |||
h0:0, eth0:1, eth0:2 etc. where | 0, eth0:1, eth0:2 etc. where | |||
eth0 is the actual interface being aliased. | eth0 is the actual interface being aliased. | |||
AUTHOR | AUTHOR | |||
Teemu Toivola <tst at iki dot fi> | Teemu Toivola <tst at iki dot fi> | |||
SEE ALSO | SEE ALSO | |||
vnstat(1), vnstati(1), vnstat.conf(5), signal(7) | vnstat(1), vnstati(1), vnstat.conf(5), signal(7) | |||
version 2.8 SEPTEMBER 2021 VNSTATD(8) | version 2.9 JANUARY 2022 VNSTATD(8) | |||
End of changes. 16 change blocks. | ||||
41 lines changed or deleted | 47 lines changed or added |