On 23.03.2020 09:29, Michael Tremer wrote:
Hi,
Hi,
Thanks for looking into this.
No problem - had fun. ;-)
On 22 Mar 2020, at 12:08, Matthias Fischer matthias.fischer@ipfire.org wrote:
Hi,
I successfully built 'vnstat 2.6' under Core 142/32bit. ... start section would need: 'vnstatd -d --alwaysadd'
Yes, you can simply use the standard functions that our initscripts have here.
https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/initscripts/system/tem...
Thanks. Will take a deeper look at this. I already implemented loadproc and killproc. Works.
...
Should we add a function to the initscript that checks if any files like that exist and then run a conversion command?
That would be safe, even if people restore an older backup.
Will take a look at this. It looks as if a conversion command will not be necessary for upgrading. If 'vnstatd' finds old interface files, they will be automatically converted and a new 'vnstat.db' will be created. Worked here.
- Since the graphs are no longer updated through 'makegraphs', I
created a symlink in '/etc/fcron.minutely' to '/var/usr/sbin/vnstat' (*No* parameters, '-u' doesn't exist anymore).
Makegraphs does some other things, too. I am not sure if we can remove the symlink, yet.
I just commented the 'vnstat' command. The '-u'-parameter is no longer needed/supported.
Now every minute 'vnstat' now grabs the data collected by'vnstatd'.
The vnstat call can of course be removed.
Yes. Of course. ;-)
That was a mistake on my part.
Removed. Works...
- Edited 'traffic.cgi', changed:
system("/usr/bin/vnstati -c 5
To:
system("/usr/bin/vnstati -c 2
This keeps the graphs a bit more "updated". From 'man vnstat': '-c (--cache-time) => Update output file only if at least *time* minutes have passed since the previous file update.
I think once a minute is cool too. It does not take a lot to generate those and I think it is valuable that they are recent.
Changed to '1'. Works.
Attachments: Screenshot fomr my testmachine after importing the old interface files from my production machine. I made some minor adjustments to 'vnstat.conf', attached.
What are those?
E.g., I removed interface "green0". I left it empty, but I will test if we really can change this to: Interface "".
I'll send the other changes in a seperate mail.
Best, Matthias