0

When I run

service vnstat status

No result is returned. Usually one of the following three results would come up. But I got nothing when checking the service status.

vnstat (pid  94330) is running...
vnstat is stopped
vnstat: unrecognized service

Vnstat doesn't update interfaces bandwidth data automatically. How to fix it?

Purres
  • 239
  • 1
  • 4
  • 18

1 Answers1

0

The current repo package doesn't contain a service anymore. It does however contain a cron. (not enabled by default)

Installation :

yum install vnstat

# depends obv
vnstat -u -i eth0
vnstat -u -i eth1
vnstat -u -i bond
# the cron
EDITOR=nano crontab -e
*/5 * * * * root /usr/sbin/vnstat.cron
# edit your options inside /etc/sysconfig/vnstat
VNSTAT_OPTIONS="-i bond0 -i eth0 -i eth1"

I hope it helps you.

Also check that /var/lib/vnstat/* files are read/writable by the user who does the cron (in this example its root)

SvennD
  • 749
  • 5
  • 18