mcktr / check_fritz

Check plugin written in Go to monitor a Fritz!Box
GNU General Public License v2.0
32 stars 10 forks source link

Fix downstream_max/upstream_max for cable devices #82

Closed mcktr closed 4 years ago

mcktr commented 4 years ago

Implements a new query algorithm for the methods downstream_max and upstream_max. The new algorithm will now perform multiple queries since the needed information to calculate the values for the methods downstream_max and upstream_max can be stored in additional sync groups. The first query will always determine how many sync groups are found. If only one sync group is found the result from this query will be used for calculation, if multiple sync groups are found the algorithm queries all sync groups but stops when a supported sync group mode is found. Currently only the sync group modes VDSL and CABLE are supported.

fixes #72

mcktr commented 4 years ago

Pre-Compiled binaries for this PR can be found here: https://github.com/mcktr/check_fritz/actions/runs/130094218

@dirkpauli @uclara Can you do me a favor and test this PR? :-) Please have a look if the speed is now calculated correctly for the methods downstream_max and upstream_max. If anything is not correct please let me know, please perform a debug using the --debug parameter and include the information in your report.

uclara commented 4 years ago

@mcktr it seems working fine on my FRITZBox 6591 Cable, but not on my DSL FRITZ!Boxes. There i get the following messages:

UNKNOWN - Could not find a supported SyncGroup (VDSL or CABLE); found the following: IP-Client

UNKNOWN - Could not find a supported SyncGroup (VDSL or CABLE); found the following: DSL

I have some with DSL and some that runs in IP-Client mode

Ulli

mcktr commented 4 years ago

@uclara Thanks for testing! :+1:

I updated this PR to support DSL and ´IP-Client` SyncGroups as well. Can you please do another test? :-)

New pre-compiled binaries can be found here: https://github.com/mcktr/check_fritz/actions/runs/131363772

Do you know about another connection technology which should be supported? I only have fiber in my mind but I don't know the SyncGroup definition. I tried to lookup the SyncGroupMode definitions but unfortunately the documentation from the manufacture does not provide any information about it (or I just can't find them).

I also can add a hidden parameter where you can pass the name from the SyncGroupMode. This way every connection technology should be covered as long as the calculation stays the same. When you find a unsupported mode you make a debug run, you extract the SyncGroupMode and pass it via the hidden parameter and in theory you now should be able to get correct downstream_max and upstream_max values. I am unsure about this. I like to hear your opinion on this @uclara :-)

uclara commented 4 years ago

@mcktr I discovered an other SyncGroup, with a FRITZ!Box 7490 International, based on a custom profile for Internet connection. It's located behind an Microtik FTTH router that forwards the whole incoming traffic via "Full NAT" to the FRITZ!Box

UNKNOWN - Could not find a supported SyncGroup (DSL, VDSL, CABLE, IP-Client); found the following: ATA

The option selected for this "other Internet Provider" is the following:

image

Ulli

mcktr commented 4 years ago

Mh, ATA is the same SyncGroupMode that is configured as additional SyncGroupMode on cable connections. If I add this we get the same result as beforehand: wrong downstream_max, upstream_max values.

Thanks for testing though! I highly appreciate your effort here to test a bunch of connection types.:heart:.

mcktr commented 4 years ago

Closing here since this PR is not suitable for fixing the linked issue.