0

Ubuntu 16.04LTS, I just installed vnstat. Seems, it's not update statistic. What should be correct chmod 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
  • Why do you think permissions are the problem? – muru Nov 14 '18 at 23:25
  • I'm not sure, based on similar case, the permissions are different there. – minto Nov 14 '18 at 23:37
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 that 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.

  • 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. – Lazarus Long Nov 16 '18 at 5:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.