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 #34

Open
franko108 opened this issue Oct 17, 2019 · 5 comments
Open

vnstat --dumpdb #34

franko108 opened this issue Oct 17, 2019 · 5 comments

Comments

@franko108
Copy link

Hello,
I'm not sure how much are you maintaining this project.
vnstat from version 2.0 doesn't support command vnstat --dumpdb as it is currently required for your frontend to fill the data from vnstat.
Here is the ticket and suggestion from vnstat maintainer: vergoh/vnstat#141
Seems that the best option would be using command:
vnstat --json
which exports data to json format and then to parse it properly.
What is your opinion?

I know, you may answer - "well, try to fix it yourself" . Maybe, not sure/not much time at the moment.

Thanks.
All the best,
Frank

@richardh538
Copy link

richardh538 commented Jul 13, 2020

Any news? Does anyone have a patch for this? Any reactions what so ever?

EDIT: Well, I ditched the vnstat-php-project, nothing seems to happen and when I started to re-write, I found vnstati which itself can give the same/or more extensive information

I replaced it with vnstati and this php-code:

exec('vnstati -s -i eno1 -o eno1_s.png', $vnstat);
exec('vnstati -d -i eno1 -o eno1_d.png', $vnstat);
exec('vnstati -5 -i eno1 -o eno1_5.png', $vnstat);
exec('vnstati -t -i eno1 -o eno1_t.png', $vnstat);
exec('vnstati -hg -i eno1 -o eno1_hg.png', $vnstat);

Then img source the files created...

Matter closed for my part.

@vladns
Copy link

vladns commented Jul 27, 2020

Any news? Does anyone have a patch for this? Any reactions what so ever?

EDIT: Well, I ditched the vnstat-php-project, nothing seems to happen and when I started to re-write, I found vnstati which itself can give the same/or more extensive information

I replaced it with vnstati and this php-code:

exec('vnstati -s -i eno1 -o eno1_s.png', $vnstat);
exec('vnstati -d -i eno1 -o eno1_d.png', $vnstat);
exec('vnstati -5 -i eno1 -o eno1_5.png', $vnstat);
exec('vnstati -t -i eno1 -o eno1_t.png', $vnstat);
exec('vnstati -hg -i eno1 -o eno1_hg.png', $vnstat);

Then img source the files created...

Matter closed for my part.

Hello! Is it possible for more details please? Where should these lines be placed?

@richardh538
Copy link

richardh538 commented Jul 28, 2020

Don't overwrite any existing files, create a new site on your webserver.
Install vnstati apt install vnstati (if running debian/ubuntu)
Download index.txt
Change extension of this file to php.
Fix ownership/etc
Edit the interfaces, if their names differ from eno1 and enp11s0.
See this as a hack.

@thrau
Copy link

thrau commented Aug 25, 2020

Any news? Does anyone have a patch for this? Any reactions what so ever?

i've created a fork that makes vnstat-php-frontend work with vnstat2 and the newly introduced --json flag that outputs the data as json. works with vnstat 2.6, but not well tested yet though.
since there doesn't seem to be activity in this repo anymore, i'm not bothering with a PR for now.

https://github.com/thrau/vnstat2-php-frontend

@LxNix
Copy link

LxNix commented Nov 3, 2021

A wrapper that reads the --json output and converts to --dumpdb lookalike.

1.modify config.php:
$vnstat_bin = '/xxx/myvnstat.py'

2.modify myvnstat.py:
eth0 -> "Monitoring network card"

myvnstat.zip

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

No branches or pull requests

5 participants