Hello,
the vnstat configfile located in /usr/local/etc/vnstat.conf is overwritten after every reboot (or restart of the service). Since the plugin in OpnSense is not using our default date notation (YY-MM-DD and not DD-MM-YY) etc ... I have modified the config file, but how can I keep the modified config after reboot? Changing the .sample file as well didn't help.
If not possible, maybe make the parameters available in the OpnSense GUI?
Will try to solve it by copying the saved config over the default config after boot (not tested yet), created the following file. I will not expect issues?
/usr/local/etc/rc.syshook.d/start/93-vnstat
#!/bin/sh
echo -n "Restoring vnstat config"
cp /usr/local/etc/vnstat.conf.restore /usr/local/etc/vnstat.conf
You could change the template.
https://github.com/opnsense/plugins/blob/master/net/vnstat/src/opnsense/service/templates/OPNsense/Vnstat/vnstat.conf
Thanks a lot, that's indeed easier.
Wasn't aware of this template.