vnstat in pfSense 2.4.5
-
Because of the snort package and dependencies, I had to upgrade vom pfSense 2.4.4p3 to 2.4.5. Things are generally working fine, except for vnstat, which is producing the below error:
Error: Failed to open database "/var/db/vnstat/vnstat.db" in read-only mode. The vnStat daemon should have created the database when started. Check that it is configured and running. See also "man vnstatd".
/var/db/vnstat/vnstat.db does not exist at all, there are individual files per interface.
I have seen that vnstat is not currently maintained. And I have googled around, and found (besides a related bug report) that the manual of vnstat suggests that -u is a very common parameter. So it would seem to me that I cannot get vnstat to work with config changes, but that a newly compiled version would be required...?
Any hint on what I could do? A daily mail with vnstat produced traffic graphs was a great help for me to determine if something is grossly out of bounds...
Thanks!
-
Did you install it manually? vnstat 2.0 has a bunch of changes from the older version.
The Status_Traffic_Totals package uses vnstat as a backend and it handles all the setup. You would need to at least go in and enable it there.
-
Yes, I did install it via the Status_Traffic_Totals package. Output data from that package in the GUI stops as of the update date, April 26. I've just created new graphs, showing nothing since April 26:
And shouldn't there be some data in the "Data Summary"?
-
There should be, yes. Click the button to reset graphing data and see what happens after that.
-
but traffic total is broken afaik under 2.4.5
https://redmine.pfsense.org/issues/10429
https://forum.netgate.com/topic/151914/traffic-totals-hourly-report-problem/command line should work tho
[2.4.5-RELEASE][root@pfSense.trmultiservice.lab]/root: rm /var/db/vnstat/vnstat.db
[2.4.5-RELEASE][root@pfSense.trmultiservice.lab]/root: /usr/local/sbin/vnstatd -d No interfaces found in database, adding available interfaces... Interface "em0" added with 1000 Mbit bandwidth limit. Interface "em1" added with 1000 Mbit bandwidth limit. Interface "em2" added with 1000 Mbit bandwidth limit. Interface "enc0" added with 1000 Mbit bandwidth limit. Interface "pflog0" added with 1000 Mbit bandwidth limit. Interface "pfsync0" added with 1000 Mbit bandwidth limit. Interface "gif0" added with 1000 Mbit bandwidth limit. Interface "ovpnc1" added with 1000 Mbit bandwidth limit. -> 8 new interfaces found. Limits can be modified using the configuration file. See "man vnstat.conf". Unwanted interfaces can be removed from monitoring with "vnstat --remove".
[2.4.5-RELEASE][root@pfSense.trmultiservice.lab]/root: vnstat -h -i em0 em0: Not enough data available yet.
after 1 hour more or less
[2.4.5-RELEASE][root@pfSense.trmultiservice.lab]/root: vnstat -h -i em0 em0 / hourly hour rx | tx | total | avg. rate ------------------------+-------------+-------------+--------------- 2020-04-28 18:00 458.07 MiB | 38.83 MiB | 496.90 MiB | 1.16 Mbit/s 19:00 784.38 MiB | 54.92 MiB | 839.30 MiB | 3.91 Mbit/s ------------------------+-------------+-------------+---------------
-
It's really not broken on 2.4.5 in general. Maybe a couple edge cases (like hourly always being cumulative no matter which option you choose). In general it's fine.
-
Ok, so resetting the data has helped a bit. I've waited before coming back, because I'd hoped that the daily data would recover, but there is still no data there under "Data Summary". However, the rest appears to be working meanwhile.
I'll say "thanks!" at this point, because with this, I can get the e-mails to me working again, which is the part I need.
Thanks!