Description of problem: Vnstat fails to log traffic. Queries on any interface result in the error message: "Not enough data available yet.". The underlying problem is that the /usr/lib/systemd/system/vnstat.service file is miss-configured. Version-Release number of selected component (if applicable): 1.15-2.el7 How reproducible: 100% always fails to report traffic. Steps to Reproduce: 1. execute query: "vnstat -i <some interface> -<one of h|d|w|m>" 2. 3. Actual results: "vnstat -i <some interface> -<one of h|d|w|m>" <some interface>: Not enough data available yet. Expected results: A report to standard out configured per the hour|day|week|month. Additional info: Solution: 1) stop vnstat service. 2) disable vnstat service. 3) remove all files in "/var/lib/vnstat/". 4) edit the /usr/lib/systemd/system/vnstat.service file, replace "vnstat -n" with "vnstat -d". 5) enable vnstat service. 6) start vnstat service. Long term solution, change the package to invoke the daemon ( -d option).
Hmm, this is strange. My vnstat.service files contains the following: [Service] User=vnstat ExecStart=/usr/sbin/vnstatd -n ExecReload=/bin/kill -HUP $MAINPID It starts vnstatd (with a trailing d) and not daemonizing a service is the preferred way when using systemd. As far as I see it, everything is set up correctly with the vnstat service file. A new installed vnstat creates a /var/lib/vnstat directory which is owned by the user vnstat. If I start vnstat with 'systemctl start vnstat' and wait 5 minutes the vnstatd daemon collects data and stores it in /var/lib/vnstat which can then be queried using vnstat (without d). The only thing necessary is to wait 5 minutes or change the configuration file. Does it work differently for you.