0

Ubuntu 16.04LTS. I just installed vnstat. Seems it's not updating statistics. What should be the correct permissions for all interfaces?

jettay@ubuntu3:/var/lib/vnstat$ ll /var/lib | grep vnstat
drwxr-xr-x  2 vnstat        vnstat         4096 Nov  9 21:44 vnstat/
jettay@ubuntu3:/var/lib/vnstat$ ls -la
total 24
drwxr-xr-x  2 vnstat vnstat 4096 Nov  9 21:44 .
drwxr-xr-x 78 root   root   4096 Nov  9 21:39 ..
-rw-r--r--  1 vnstat vnstat 2792 Nov 15 01:05 eth0
-rw-r--r--  1 vnstat vnstat 2792 Nov 15 01:05 .eth0
-rw-r--r--  1 vnstat vnstat 2792 Nov 15 01:05 wlan0
-rw-r--r--  1 vnstat vnstat 2792 Nov 15 01:05 .wlan0
Zanna
  • 69,223
  • 56
  • 216
  • 327
minto
  • 811
  • 7
  • 17
  • 32
  • Why do you think permissions are the problem? – muru Nov 14 '18 at 23:25
  • I'm not sure, based on similar [case](https://askubuntu.com/questions/500663/vnstat-not-updating), the permissions are different there. – minto Nov 14 '18 at 23:37

1 Answers1

1

Have you tried running vnstat -l -i wlan0? That should give you a live feed of it running. Can you see the statistics updating there?

Or are you looking for logs?

vnstat -i eth0 --exportdb

For me I had to set the default interface in /etc/vnstat.conf, however the previous command bypasses it if you name the proper interface.

As suggested in a similar case, did you try to set the ownership appropriately?

sudo chown -R vnstat:vnstat /var/lib/vnstat 

Maybe we can test it by temporarily elevating them all to 755 through something like:

sudo chmod -R 755 /var/lib/vnstat

Let us know if any of this helped and maybe we can narrow it down.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Pierce Devol
  • 138
  • 8
  • Yes, I set the ownership use `sudo chown -R vnstat:vnstat /var/lib/vnstat`. I tried run `vnstat -l -i wlan0`: I can see the updated data, ok. Two points not fully clear: after I turn on or rebooting PC: do I need each time start the `vnstatd` daemon for constant traffic monitoring? I didn't do it. How to see traffic used for each day? `vnstat -i wlan0 -d` show only first day (when it was installed) and current day, but traffic used in other days not displayed. – minto Nov 15 '18 at 18:45
  • I believe that you need to set up a config for it to load with the correct settings each time. Try editing ```/etc/vnstat.conf``` and setting the appropriate interface. – Pierce Devol Nov 16 '18 at 05:50