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: Statistics tabs not showing #3174

Closed
MichaelTrip opened this issue Oct 25, 2022 · 11 comments
Closed

Vnstat: Statistics tabs not showing #3174

MichaelTrip opened this issue Oct 25, 2022 · 11 comments
Labels
help wanted Contributor missing

Comments

@MichaelTrip
Copy link

MichaelTrip commented Oct 25, 2022

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

When i try to open the Services menu --> VNStat --> Hourly statistics, or daily or monthly or Yearly Statistics, the screen remains empty.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'services'
  2. Click on 'VnSat'
  3. click on 'any of the statistics'
  4. Empty

Expected behavior
Seeing statistics of vnstat. It is working on the cli though.

Screenshots

2022-10-25T15:28:53,258008749+02:00
2022-10-25T15:28:58,736087541+02:00

Environment

OPNsense 22.7.6-amd64
FreeBSD 13.1-RELEASE-p2
OpenSSL 1.1.1q 5 Jul 2022

@patschi
Copy link
Contributor

patschi commented Oct 25, 2022

Do you have more than 4 interfaces selected in the vnstat settings? I know there's some known restriction/bug that when you select too much interfaces, it stops working. Apparently some *nix-kernel restriction, if I recall.

Seeing statistics of vnstat. It is working on the cli though.

What is the exact command you're running on the CLI?

@MichaelTrip
Copy link
Author

MichaelTrip commented Oct 25, 2022

Do you have more than 4 interfaces selected in the vnstat settings? I know there's some known restriction/bug that when you select too much interfaces, it stops working. Apparently some *nix-kernel restriction, if I recall.

I have selected al of my 10 interface. I have now selected only 4 of them. Still no change.

Seeing statistics of vnstat. It is working on the cli though.

What is the exact command you're running on the CLI?

just running vnstat

root@OPNsense:~ # vnstat

                      rx      /      tx      /     total    /   estimated
 enc0:
       Oct '22           0 B  /         0 B  /         0 B  /     --     
     yesterday           0 B  /         0 B  /         0 B
         today           0 B  /         0 B  /         0 B  /     --     

 igb0:
       Oct '22      1.17 TiB  /    1.25 TiB  /    2.42 TiB  /    3.03 TiB
     yesterday    118.78 GiB  /   99.10 GiB  /  217.89 GiB
         today    121.04 GiB  /  122.21 GiB  /  243.25 GiB  /  288.29 GiB

 igb0_vlan1100:
       Oct '22           0 B  /         0 B  /         0 B  /     --     
     yesterday           0 B  /         0 B  /         0 B
         today           0 B  /         0 B  /         0 B  /     --     

 etc..

@DjSni
Copy link

DjSni commented Feb 18, 2023

here too have the same issue

@OPNsense-bot
Copy link

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository,
please read https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue,
just let us know, so we can reopen the issue and assign an owner to it.

@OPNsense-bot OPNsense-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2023
@OPNsense-bot OPNsense-bot added the help wanted Contributor missing label Apr 23, 2023
@QuarkZ26
Copy link

Please reopen this, it's still hasn't been fixed. Or provide an alternative.

@mimugmail
Copy link
Member

Its a problem of vnstat itself

@mpfusion
Copy link

I'm having the same problem and can reproduce it with OPNsense 24.1.1-amd64 and vnStat 2.11. I've selected a single interface and the tabs are empty. The vnstat command does produce output, so that's working.

I'm surprised to see this bug closed if it's still an unsolved issue.

@QuarkZ26
Copy link

It's actually working now for me, though I don't really know why since I hadn't used it since it was broken. I reinstalled Opnsense from scratch at some point and it's likely the reason.

A few days ago, I decided to try again, installed the plugin, deselected/reselected WAN in the options, and it's working. If it's not working for you, then I'm guessing there's some remnant files that needed cleaned up on the system itself.

@mpfusion
Copy link

I reset the config and now the stats appear, indeed. This sadly deleted the history, though. But at least the stats show up now.

@vergoh
Copy link

vergoh commented Feb 13, 2024

Do you have more than 4 interfaces selected in the vnstat settings? I know there's some known restriction/bug that when you select too much interfaces, it stops working. Apparently some *nix-kernel restriction, if I recall.

Mainly for future reference, this limitation was caused by the interface name being limited to 31 characters which often resulted in around 4 interfaces being the limit when the interface1+interface2+... syntax was used (which is something this plugin does). This limitation no longer exists start from vnStat 2.10.

Its a problem of vnstat itself

As already pointed out, vnstat will still produce results from CLI which suggests the issue is somewhere in the plugin's implementation.

I reset the config and now the stats appear, indeed.

I've tried to understand how the plugin has been implemented and "Reset" appears to only be removing the database directory and then proceeding the same flow as pressing "Save" would. There aren't any plugin related files being stored in vnStat's database directory so it's rather strange "Reset" would result in the situation something fixing itself, unless it's somehow some file/directory permission issue. In that case, one of the system logs should contain some error message indicating what the issue is.

@lexxxel
Copy link

lexxxel commented Jul 23, 2024

Do you have more than 4 interfaces selected in the vnstat settings? I know there's some known restriction/bug that when you select too much interfaces, it stops working. Apparently some *nix-kernel restriction, if I recall.

Mainly for future reference, this limitation was caused by the interface name being limited to 31 characters which often resulted in around 4 interfaces being the limit when the interface1+interface2+... syntax was used (which is something this plugin does). This limitation no longer exists start from vnStat 2.10.

I have this issue with one single interface. I added a second WAN and whenever I switch over to that OR any other interface except the original WAN, I see empty tabs. Only if I select the first WAN, I do get the tabs with the correct tables.

Turns out, vnstat interface might not correlate with the options given in opnsense. For example, I have an PPPoE connection via a VLAN and that interface is the same as my LAN. If I select that PPPoE interface, I will get an empty response. If you have this error, run vnstat on the machine and check if the interface match with the selected ones in the opnsense UI or run vnstat -h and see if you get an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributor missing
Development

No branches or pull requests

9 participants