From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: Re: Updating 'vnstat' to 2.6 - need some help with necessary changes Date: Mon, 23 Mar 2020 21:43:01 +0100 Message-ID: <55fba60f-0126-2144-44eb-a93b2e5924bb@ipfire.org> In-Reply-To: <41B80EB9-24FB-48C4-967C-6268CCC1098D@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0710777967870299603==" List-Id: --===============0710777967870299603== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 = wrote: >>=20 >> Hi, >>=20 >> I successfully built 'vnstat 2.6' under Core 142/32bit. >> ... >> start section would need: >> 'vnstatd -d --alwaysadd' >=20 > Yes, you can simply use the standard functions that our initscripts have he= re. >=20 > https://git.ipfire.org/?p=3Dipfire-2.x.git;a=3Dblob;f=3Dsrc/initscripts/sys= tem/template;h=3D69dc2a6a2202fb30da61a7fff6625aea531802e9;hb=3DHEAD Thanks. Will take a deeper look at this. I already implemented loadproc and killproc. Works. > ... >=20 > Should we add a function to the initscript that checks if any files like th= at exist and then run a conversion command? >=20 > 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. >> 8. 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). >=20 > 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'. >=20 > The vnstat call can of course be removed. Yes. Of course. ;-) That was a mistake on my part. Removed. Works... >>=20 >> 9. Edited 'traffic.cgi', changed: >>=20 >> system("/usr/bin/vnstati -c 5 >>=20 >> To: >>=20 >> system("/usr/bin/vnstati -c 2 >>=20 >> This keeps the graphs a bit more "updated". >> From 'man vnstat': >> '-c (--cache-time) =3D> Update output file only if at least *time* minutes >> have passed since the previous file update. >=20 > 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. >=20 > 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 --===============0710777967870299603==--