alexandermarston / vnstat-dashboard

A responsive web UI to view network traffic statistics provided by vnStat (with support for version 2.x)
https://alexandermarston.github.io/vnstat-dashboard/
142 stars 60 forks source link

errors #52

Open mu-us61 opened 3 years ago

mu-us61 commented 3 years ago

Fatal error: Uncaught Exception: JSON is invalid in /var/www/html/includes/vnstat.php:60 Stack trace: #0 /var/www/html/includes/vnstat.php(44): vnStat->processVnstatData('') #1 /var/www/html/index.php(27): vnStat->__construct('/usr/bin/vnstat') #2 {main} thrown in /var/www/html/includes/vnstat.php on line 60

tomangert commented 3 years ago

I don't think this branch works well with vnstat 2.x yet.

I have a version here that works for me: https://github.com/tomangert/vnstat-dashboard

Feel free to try it

sebelk commented 2 years ago

@tomangert Hi, I've tried both this one and your version and none of them work. They fail with error that @e4e6 reported.

tomangert commented 2 years ago

What vnstat version are you using? I am running with 2.6 and tested with several older versions. Maybe newer versions changed something.

sebelk commented 2 years ago

@tomangert I've installed vnstat into the running container and worked fine. I think that I was missing something... this images does not provides vnstat and expects that a Debian host provide it, does it?

tomangert commented 2 years ago

Yes vnstat has to be installed separately. Rpm, deb, source, whatever works for you.

Then set $vnstat_bin_dir to point to the executable in include/config.php

airysoar commented 2 years ago

Yes vnstat has to be installed separately. Rpm, deb, source, whatever works for you.

Then set $vnstat_bin_dir to point to the executable in include/config.php

Try your your version,still not work.The error show :Fatal error: Uncaught Exception: JSON is invalid in /var/www/html/includes/vnstat.php:60 Stack trace: #0 /var/www/html/includes/vnstat.php(44): vnStat->processVnstatData('') https://github.com/alexandermarston/vnstat-dashboard/issues/1 /var/www/html/index.php(27): vnStat->__construct('/usr/bin/vnstat') https://github.com/alexandermarston/vnstat-dashboard/issues/2 {main} thrown in /var/www/html/includes/vnstat.php on line 60