Closed Waldorf3 closed 11 months ago
At least I'm not maintaining any distribution release specific binary builds currently. In addition to the source package, there's the docker container image available from both ghcr and dockerhub + that snap you've already found.
Assuming you have the same CPU architecture available in some non-production development environment (or VM), you should be able to backport the latest vnStat release to Debian Bookworm with relative ease using the Debian packaging setup from the older release as base and then create the .deb file which you can then transfer to the production servers and upgrade the existing version. I suspect Debian has somewhere also official documentation on how to do this but the way I recall the process is something like
apt-get build-dep vnstat
apt-get source vnstat
debian
directory there from what the previous command provideddebian/rules binary
and if that's still a valid process and nothing went wrong then you should now have .deb files builtObviously ymmv, I haven't tested this in several years.
Recompiling system binaries are unfortunately beyond my paygrade. The docker solution would work on servers with docker but maybe a bit of an overkill otherwise.
Going with vnstat 2.6, is there a way to force the output into MB/GB/TB rather than let it auto-adjust? I want to use the estimate output to be able to send a warning if traffic estimates exceeds limits. I could simply do something like vnstat -m | grep estimated | awk '{printf "%d\n", $8}'
- if only i could be sure whether the value is MB/GB/TB...
If you are comfortable compiling binaries from source packge then the extra steps needed for creating the .deb package when the debian files for an earlier release using the same build mechanism exists shouldn't be that big of a step.
Are you sure you have Debian Bookworm in use and not Bullseye? According to https://packages.debian.org/search?keywords=vnstat the vnStat version available in Bookworm should be 2.10 instead of the 2.6 you've mentioned.
Normally I'd suggest that you'd use --json
instead of trying to parse the more human readable outputs but --json
doesn't have the estimates included that you are looking for. There's also no option for disabling the automatic unit changes because the used columns lack the ability of adjusting the width based on the length of the values. That --json
should still be usable but you'd need to calculate the estimate based on the current value, update time and days of month, which is something that's not going to be pretty if done as a one liner with shell commands.
omg, you're right. Of all the servers running bookworm, the one I installed it on first was still running bullseye. Duh. Well, upgraded and problem solved.
Tested it with --alert, this is some premium class software, love the configurability, well done!
Thanks, and sorry for wasting your time.
Is there a repo or a Debian Bookworm compatible .deb file available somewhere?
Target are low powered production servers so I don't want to have dev environments or snap.