centosmonitortrafficnetwork-monitoring

vnstat not updating on certain interfaces


vnstat is updating only one interface every five minutes. I have to use vnstat -u to manually update the rest of interfaces. All interfaces are already enabled, but only one interface is updating every 5 minutes.


Solution

  • Check which user the vnstat daemon is running as using ps aux | grep [v]nstat.

    I recently had the same problem and after priming the database with vnstat -u -i eth0 as root the vnstat process couldn't write to the /var/lib/vnstat/eth0 file as it was running as user "vnstat".

    If vnstat is running as user "vnstat" ensure that it has permission to write to /var/lib/vnstat/eth0.