Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vnstat --dumpdb #141

Closed
franko108 opened this issue Oct 17, 2019 · 3 comments
Closed

vnstat --dumpdb #141

franko108 opened this issue Oct 17, 2019 · 3 comments

Comments

@franko108
Copy link

Hi,
I have a front end https://github.com/bjd/vnstat-php-frontend , used for a very long time and it worked fine.
On the vnstat version 2.4, the command for collecting the data doesn't work anymore:
$ sudo vnstat --dumpdb
Unknown parameter "--dumpdb". Use --help for help.
This is on the Debian 10. I have an instance on Centos 7 with vnstat 1.5 and there this command is working fine.
I couldn't find in the manual the command that is doing the same job (hopefully, collect the data in the same format as it is used by frontend).

Thank you,
Best,
Frank

@vergoh
Copy link
Owner

vergoh commented Oct 17, 2019

The database implementation was rewritten in version 2.0 resulting in more logging options and configurability becoming available. For example, 1.x versions don't have -5, --y or the possibility of configuring data retention times. Due to this rewrite, the --dumpdb (which was renamed --exportdb in version 1.12 released in 2014 but still kept for compatibility) would not have anyway produced a fully matching output if all the new features would also have been shown due to the output not having any sort of versioning. --json support was introduced with versioning in version 1.14 (2015) and has been the suggested output format for external implementation use among --xml as both are versioned, usually directly supported by scripting and programming languages and provide options for limiting the output for only the needed dataset.

I'd suggest trying to get in touch with the author of vnstat-php-frontend for getting support for the --json output which is most likely the easiest to parse directly with php. The (not as suggested) alternative would be to write a wrapper that reads the --json output and converts to --dumpdb lookalike on the fly.

@mallory98e
Copy link

Dude like wtf this blows my mind, I just upgraded some of my servers from wheezy (ik) and this feature I used to extract hourly, daily data for monitoring, it's ok to implement new fancy shit like json but for gods sake leave the legacy features intact now I can spend half day to try to make sense of this json trash and adopt it for my scripts, I'm not impressed.

@vergoh
Copy link
Owner

vergoh commented Feb 23, 2024

@mallory98e - thanks for the feedback. However, please see my comment above from 2019 that explains why this had to be done. I hope you'll also find the other new features made possible by the database redesign useful. The https://github.com/vergoh/vnstat/blob/master/CHANGES file and "New configuration settings" section of https://github.com/vergoh/vnstat/blob/master/UPGRADE.md are likely the best sources for getting information of what's new and what else has changed since the older version you've been using. I'm also glad to hear (based on it not being mentioned) that no data was lost as a result of the upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants