OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: Ricardo on February 04, 2020, 03:30:04 pm

Title: Permanent VNSTAT database on MFS
Post by: Ricardo on February 04, 2020, 03:30:04 pm
Hello Opnsense folks,

https://forum.opnsense.org/index.php?topic=9503.msg48562#msg48562

is this something that we can expect to be supported? VNSTAT database to be kept across reboots, when /var is on MFS.
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 04, 2020, 04:02:26 pm
Are you soder10 in Github?

Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 04, 2020, 04:52:44 pm
I found others posted to this thread in the past, and got notification about this issue recently.

https://github.com/opnsense/plugins/issues/1061
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 04, 2020, 05:05:54 pm
Do you use pppoe as WAN?
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 05, 2020, 09:41:50 am
Exactly!
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 05, 2020, 09:51:05 am
Can you check if this also happens on LAN interface?
Just for testing if it's related to vnstat itself or the plugin.

We upgraded from 1.X to 2.X couple of weeks ago.
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 05, 2020, 11:31:33 am
I will try. What should be the visible result? No service crash / preserve traffic amount across reboots?
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 05, 2020, 12:19:46 pm
Hopefully both ...
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 05, 2020, 01:01:16 pm
Will try today evening to switch over from WAN to LAN interface measurement. What is the next step if it seems working fine bound to the LAN?
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 05, 2020, 02:44:07 pm
Next stop would be disable MFS and switch back to pppoe.
Then you'll see if it's pppoe or MFS
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 09, 2020, 07:13:11 am
Ok, it took some time to find a proper time for reboot, but here it is:

changing the listen interface from WAN/pppoe to the static LAN interface still broke the vnstat service to start. Trying to start the service manually also fails.
Reset-ing the vnstat database immediately started the service without hiccup.

Next test: switched from MFS to normal UFS for /var -> did fix the service startup issue, but database had to be reset, otherwise the stat pages showed an empty page. After the 1st reset, because it is no longer stored on MFS, the next full reboot was also successful, did not have to reset the database again.
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 09, 2020, 07:30:23 am
Thanks for your input!
vnstat changed it's logging database from db2 to sqlite, so from v1.x to v2.x there's no chance other than wiping the DB. We sadly forgot to mention this in the release note.
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on February 09, 2020, 07:51:52 am
I did change from UFS back to MFS (switched back to WAN  interface) and this time it seems somehow it saved the database file correctly. I will try to see after a couple of reboots it is still correct or not.
Title: Re: Permanent VNSTAT database on MFS
Post by: mimugmail on February 09, 2020, 08:43:14 am
Thanks :)
Title: Re: Permanent VNSTAT database on MFS
Post by: Ricardo on June 20, 2020, 10:33:14 am
Thanks :)

So far it has survived couple of reboots and seems still working. Lets hope 20.7 wont screw it up again.