Network Traffic Monitor

http://humdi.net/vnstat

vnStat is a network traffic monitor for Linux that keeps a log of
daily network traffic for the selected interface(s). vnStat isn't a
packet sniffer. The traffic information is analyzed from the /proc
filesystem, so vnStat can be used without root permissions.

Refresh
Refresh
Source Files (show merged sources derived from linked package)
Filename Size Changed Actions
systemd234.patch 0000000628 628 Bytes 4 months
vnstat-2.4.tar.gz 0000270907 265 KB 3 months
vnstat-2.4.tar.gz.sig 0000000833 833 Bytes 3 months
vnstat-cgi.conf 0000000212 212 Bytes over 10 years
vnstat-create-db.sh 0000001378 1.35 KB over 10 years
vnstat-if.sh 0000000398 398 Bytes over 10 years
vnstat.changes 0000027614 27 KB 3 months
vnstat.init 0000004003 3.91 KB over 5 years
vnstat.keyring 0000003061 2.99 KB 7 months
vnstat.spec 0000005265 5.14 KB 3 months
Comments for vnstat 6

Dirk Stoecker's avatar

dstoecker wrote 7 months ago

1.18 does no longer work on Leap 15 due to section "# Hardening" in systemctl file. It can't access the database files. It seems the StateDirectory variable does not yet exist for systemd. I didn't investigate deeper, but simply disable all the new options.


Chris O's avatar

ochristi wrote 7 months ago

I just checked, on my systems the directory did exist before 1.18, I just updated vnstat to 1.18 and did not see any apparent issues. Which systemd version are you running? Maybe this is just an issue on fresh installs and systemd expects the directory (StateDirectory=vnstat -> /var/lib/vnstat) to be present, which is only created during runtime?


Dirk Stoecker's avatar

dstoecker wrote 7 months ago

systemd-234-lp150.20.15.1.x86_64, standard 15.0 Update

How did you check?

It works, but does not write data files → i.e. does nothing useful:

Apr 09 10:44:34 orwell vnstatd[31147]: Error: Unable to create database backup "/var/lib/vnstat/.eth0". Apr 09 10:44:34 orwell vnstatd[31147]: Error: Unable to write database, continuing with cached data.

This happens first time 5 minutes after start.

Also sometimes I got Apr 09 10:52:51 orwell systemd[1]: /usr/lib/systemd/system/vnstatd.service:15: Unknown lvalue 'StateDirectory' in section 'Service'


Chris O's avatar

ochristi wrote 7 months ago

I am not sure, removing the instructions will remedy the problem you were experiencing, since they should have been ignored. I am guessing for some reason your "/var/lib/vnstat/" path was not created or vnstat had no permissions to create/write there.


Dirk Stoecker's avatar

dstoecker wrote 7 months ago

No I tried that. Check existence, permissions, ownership... many things. I think the other options prevent access to this directory and StateDirectory again would allow it. Without this option it stays forbidden. Probably it would be enough to strip SOME of the other hardening options, but I didn't want to try and check each combination until I find the right one and also didn't want to dig into the docs to understand each of them to make an educated decision.


Dirk Stoecker's avatar

dstoecker wrote 7 months ago

According to https://github.com/systemd/systemd/blob/master/NEWS StateDirectory was introduced with 235. So a patch would be to disable these options for openSUSE <= 15.0 and have them for >= 15.1