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

Fix wrong values for max down-/upstream #97

Merged
merged 3 commits into from
Oct 9, 2020

Conversation

mcktr
Copy link
Owner

@mcktr mcktr commented Sep 27, 2020

Query the correct TR-064 action to collect the correct values for max downstream and upstream.

OK - Max Upstream: 36.39 Mbit/s | 'upstream_max'=36.393000;;;;

OK - Max Downstream: 116.80 Mbit/s | 'downstream_max'=116.797000;;;;

image

Important:

Since the correct values for the max down-/upstream are stored in a different TR-064 action on cable boxes it is now necessary to define the --modelgroup parameter for cable boxes.

$ ./check_fritz --password secret -m downstream_max --modelgroup cable
OK - Max Downstream: 130.47 Mbit/s | 'downstream_max'=130.465000;;;;

TODO

  • fix method downstream_usage
  • fix method upstream_usage
  • update documentation / entry for updating documentation

fixes #72
fixes #96

@mcktr mcktr added this to the 1.2.0 milestone Sep 27, 2020
@mcktr mcktr self-assigned this Sep 27, 2020
@mcktr
Copy link
Owner Author

mcktr commented Sep 27, 2020

@dirkpauli @uclara Can you please test the build?

https://github.com/mcktr/check_fritz/actions/runs/274989817

Please note that it is now necessary to provide the --modelgroup cable parameter on cable boxes. If possible please also verify this on a DSL Fritz!Box (but without the --modelgroup parameter) and if you have access to one Fritz!Box that is connected via LAN1 to the internet I am also interested in the results (in that case please test both with and without the parameter).

This is still a work in progress since I don't know if the changes work out as expected.

@uclara
Copy link

uclara commented Sep 27, 2020

@mcktr @dirkpauli

I tested all three versions (1.13, 1.14 and 1.15 - what's the difference?) in my FRITZBox 6591 Cable that runs on a Vodafone Kabel Deutschland line with 1000/50 Mbit/s. All there versions give the same value:

check_fritz_1.13:

OK - Max Downstream: 1150.00 Mbit/s | 'downstream_max'=1150.000000;;;;
OK - Max Upstream: 56.71 Mbit/s | 'upstream_max'=56.710000;;;;

check_fritz_1.14:

OK - Max Downstream: 1150.00 Mbit/s | 'downstream_max'=1150.000000;;;;
OK - Max Upstream: 56.71 Mbit/s | 'upstream_max'=56.710000;;;;

check_fritz_1.15:

OK - Max Downstream: 1150.00 Mbit/s | 'downstream_max'=1150.000000;;;;
OK - Max Upstream: 56.71 Mbit/s | 'upstream_max'=56.710000;;;;

For all there versions I used this command lines:

./check_fritz_1.1[345]/check_fritz.linux.amd64 -H <IP-Address> -P 49443 -p <Password> --modelgroup Cable -m downstream_max
./check_fritz_1.1[345]/check_fritz.linux.amd64 -H <IP-Address> -P 49443 -p <Password> --modelgroup Cable -m upstream_max

PS: I noticed that -M Cable doesn't work, instead --modelgroup Cable works

Ulli

@mcktr
Copy link
Owner Author

mcktr commented Sep 27, 2020

@uclara Thanks! 👍

I tested all three versions (1.13, 1.14 and 1.15 - what's the difference?)

The difference is the used Go version. It is sufficient when you use the latest (1.15).

Can you show us a screenshot from the Fritz!Box interface and the values from there? I have menu entry called DSL-Informationen do you have a similar one on the Fritz!Box cable?

Bildschirmfoto vom 2020-09-27 15-33-52
Bildschirmfoto vom 2020-09-27 15-34-10

Best regards
Michael

@mcktr
Copy link
Owner Author

mcktr commented Sep 27, 2020

@uclara Just for test purposes what do you get if you leave out the parameter --modelgroup cable?

@mcktr mcktr added the needs-feedback Needs further information label Sep 27, 2020
@uclara
Copy link

uclara commented Sep 27, 2020

image

image

@uclara
Copy link

uclara commented Sep 27, 2020

@mcktr: if I omit the --modelgroup cable option, I get the following error message:

UNKNOWN - Unexpected response status code: 500

@mcktr
Copy link
Owner Author

mcktr commented Sep 27, 2020

@uclara Thansk for the screenshots. I'll guess then this works didn't it? The returned values from the check plugin are the same that the Fritz!Box reports in the web interface.

Okay the 500 response code is expected when leaving out the --modelgroup parameter, I wanted to ensure the check plugin doesn't throw a panic. The missing -M parameter is already fixed in the master branch, thanks for the hint. :-)

I'll now fix the usage functions and then we can merge this and finally release an updated version.

@mcktr mcktr removed the needs-feedback Needs further information label Sep 27, 2020
@uclara
Copy link

uclara commented Sep 27, 2020

Great job!

I will try all modes again to be sure that all works as expected and will give you a feedback.

BTW: do you know if I need a valid user/password combination for the login or does a valid user with the default password used to login to the FRITZ!Box is also enough to get a valid login?
Background: I started to use a dedicated user/password combination and got lots of wrong password combinations. As soon I used the password used for login in the LAN, without user, the login was fine ...

Ulli

@dirkpauli
Copy link

dirkpauli commented Sep 27, 2020 via email

@mcktr mcktr changed the title WIP: Fix wrong values for max down-/upstream Fix wrong values for max down-/upstream Sep 27, 2020
Query the correct TR-064 action to collect the correct values for
downstream_usage and upstream_usage methods.
@mcktr mcktr force-pushed the bugfix/wrong-values-up-downstream branch from 1bf51d0 to e7ccfd0 Compare September 27, 2020 18:07
@mcktr
Copy link
Owner Author

mcktr commented Sep 27, 2020

@uclara @dirkpauli Thank you both for testing, I highly appreciate your help! 👍

I updated the pull request. Now all four functions should work as expected. Please give it another try. :-) You can find the binaries for the updated pull request here, it is sufficient when you test the binaries build with Go 1.15.

https://github.com/mcktr/check_fritz/actions/runs/275424475

If your feedback is positive I think I can release version 1.2.0 on the next Friday.

@dirkpauli

The *_usage functions weren't patched, but now they are. :-)

@uclara

BTW: do you know if I need a valid user/password combination for the login or does a valid user with the default password used to login to the FRITZ!Box is also enough to get a valid login?
Background: I started to use a dedicated user/password combination and got lots of wrong password combinations. As soon I used the password used for login in the LAN, without user, the login was fine ...

I am not sure what you mean. If you turn on the setting Anmeldung mit FRITZ!Box-Benutzernamen und Kennwort you definitely need a valid user/password combination.

@uclara
Copy link

uclara commented Sep 27, 2020

@mcktr I tested the remaining things:

LAN1 connected FRITZ!Box 6490 Cable:
--modelgroup DSL leads to
UNKNOWN - Unexpected response status code: 500

--modelgroup Lan1 leads to
OK - Max Downstream: 0.00 Mbit/s | 'downstream_max'=0.001024;;;;
OK - Max Upstream: 0.10 Mbit/s | 'upstream_max'=0.099999;;;;

--modelgroup Cable leads to
OK - Max Upstream: 0.10 Mbit/s | 'upstream_max'=0.099999;;;;
OK - Max Upstream: 0.10 Mbit/s | 'upstream_max'=0.099999;;;;

DSL connected FRITZ!Box 7490:
--modelgroup DSL leads to
OK - Max Downstream: 15.42 Mbit/s | 'downstream_max'=15.417000;;;;
OK - Max Upstream: 1.00 Mbit/s | 'upstream_max'=0.998000;;;;

--modelgroup Lan1 leads to
OK - Max Downstream: 15.56 Mbit/s | 'downstream_max'=15.564000;;;;
OK - Max Upstream: 1.01 Mbit/s | 'upstream_max'=1.008000;;;;

--modelgroup Cable leads to
OK - Max Downstream: 15.56 Mbit/s | 'downstream_max'=15.560000;;;;
OK - Max Upstream: 1.01 Mbit/s | 'upstream_max'=1.008000;;;;

@uclara
Copy link

uclara commented Sep 28, 2020

@mcktr I created a script to check all my FRITZ!Boxes that I have in my family environment ;-)

Version: check_fritz version 5a4c4a4

FRITZBox 7490 via ADSL

--modelgroup DSL :

WAN connection status:                                        OK - Connection Status: Connected; External IP: xx.yyy.zzz.200
WAN connection uptime in seconds:                             OK - Connection Uptime: 61120 seconds (0d 16h 58m 40s) | 'uptime'=61120.000000s;;;;
Device uptime in seconds:                                     OK - Device Uptime: 424063 seconds (4d 21h 47m 43s) | 'uptime'=424063.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 15.42 Mbit/s | 'downstream_max'=15.417000;;;;
Current downstream:                                           OK - Current Downstream: 12.97 Mbit/s | 'downstream_current'=12.970408;;;;
Current downstream usage:                                     OK - 80.70% Downstream utilization (12.44 Mbit/s of 15.42 Mbits) | 'downstream_usage'=80.704365;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 1.00 Mbit/s | 'upstream_max'=0.998000;;;;
Current upstream:                                             OK - Current Upstream: 0.47 Mbit/s | 'upstream_current'=0.470720;;;;
Current upstream usage:                                       OK - 37.56% Upstream utilization (0.37 Mbit/s of 1.00 Mbits) | 'upstream_usage'=37.564729;;;0.000000;100.000000

--modelgroup Cable :

WAN connection status:                                        UNKNOWN - Unexpected response status code: 500
WAN connection uptime in seconds:                             UNKNOWN - Unexpected response status code: 500
Device uptime in seconds:                                     OK - Device Uptime: 424100 seconds (4d 21h 48m 20s) | 'uptime'=424100.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 15.61 Mbit/s | 'downstream_max'=15.612000;;;;
Current downstream:                                           OK - Current Downstream: 11.59 Mbit/s | 'downstream_current'=11.592160;;;;
Current downstream usage:                                     OK - 80.23% Downstream utilization (12.52 Mbit/s of 15.61 Mbits) | 'downstream_usage'=80.227473;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 1.00 Mbit/s | 'upstream_max'=1.004000;;;;
Current upstream:                                             OK - Current Upstream: 0.56 Mbit/s | 'upstream_current'=0.563224;;;;
Current upstream usage:                                       OK - 37.74% Upstream utilization (0.38 Mbit/s of 1.00 Mbits) | 'upstream_usage'=37.737052;;;0.000000;100.000000

FRITZBox 7490 via Lan1

--modelgroup DSL :

WAN connection status:                                        OK - Connection Status: Connected; External IP: xx.yyy.zzz.200
WAN connection uptime in seconds:                             OK - Connection Uptime: 424066 seconds (4d 21h 47m 46s) | 'uptime'=424066.000000s;;;;
Device uptime in seconds:                                     OK - Device Uptime: 424141 seconds (4d 21h 49m 1s) | 'uptime'=424141.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 0.00 Mbit/s | 'downstream_max'=0.000000;;;;
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.000000;;;;
Current downstream usage:                                     UNKNOWN - Maximum Downstream is 0
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 0.00 Mbit/s | 'upstream_max'=0.000000;;;;
Current upstream:                                             OK - Current Upstream: 0.00 Mbit/s | 'upstream_current'=0.000000;;;;
Current upstream usage:                                       UNKNOWN - Maximum Downstream is 0

--modelgroup Cable :

WAN connection status:                                        UNKNOWN - Unexpected response status code: 500
WAN connection uptime in seconds:                             UNKNOWN - Unexpected response status code: 500
Device uptime in seconds:                                     OK - Device Uptime: 424187 seconds (4d 21h 49m 47s) | 'uptime'=424187.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 0.00 Mbit/s | 'downstream_max'=0.001024;;;;
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.000000;;;;
Current downstream usage:                                     OK - 0.00% Downstream utilization (0.00 Mbit/s of 0.00 Mbits) | 'downstream_usage'=0.000000;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 0.00 Mbit/s | 'upstream_max'=0.000512;;;;
Current upstream:                                             OK - Current Upstream: 0.00 Mbit/s | 'upstream_current'=0.000000;;;;
Current upstream usage:                                       UNKNOWN - Unauthorized: wrong username or password

FRITZBox 7490 via Lan1 to FTTH Router

--modelgroup DSL :

WAN connection status:                                        UNKNOWN - Unexpected response status code: 500
WAN connection uptime in seconds:                             UNKNOWN - Unexpected response status code: 500
Device uptime in seconds:                                     OK - Device Uptime: 3638393 seconds (42d 2h 39m 53s) | 'uptime'=3638393.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 0.00 Mbit/s | 'downstream_max'=0.000000;;;;
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.003784;;;;
Current downstream usage:                                     UNKNOWN - Maximum Downstream is 0
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 0.00 Mbit/s | 'upstream_max'=0.000000;;;;
Current upstream:                                             OK - Current Upstream: 0.06 Mbit/s | 'upstream_current'=0.064176;;;;
Current upstream usage:                                       UNKNOWN - Maximum Downstream is 0

--modelgroup Cable :

WAN connection status:                                        OK - Connection Status: Connected; External IP: xx.yyy.zzz.200
WAN connection uptime in seconds:                             OK - Connection Uptime: 3638360 seconds (42d 2h 39m 20s) | 'uptime'=3638360.000000s;;;;
Device uptime in seconds:                                     OK - Device Uptime: 3638414 seconds (42d 2h 40m 14s) | 'uptime'=3638414.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 0.03 Mbit/s | 'downstream_max'=0.030000;;;;
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.001936;;;;
Current downstream usage:                                     OK - 6.45% Downstream utilization (0.00 Mbit/s of 0.03 Mbits) | 'downstream_usage'=6.453333;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 0.01 Mbit/s | 'upstream_max'=0.005000;;;;
Current upstream:                                             OK - Current Upstream: 0.08 Mbit/s | 'upstream_current'=0.076928;;;;
Current upstream usage:                                       OK - 1089.12% Upstream utilization (0.05 Mbit/s of 0.01 Mbits) | 'upstream_usage'=1089.120000;;;0.000000;100.000000

FRITZBox 6591 Cable via Cable

--modelgroup DSL :

WAN connection status:                                        UNKNOWN - Unexpected response status code: 500
WAN connection uptime in seconds:                             UNKNOWN - Unexpected response status code: 500
Device uptime in seconds:                                     OK - Device Uptime: 125151 seconds (1d 10h 45m 51s) | 'uptime'=125151.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           UNKNOWN - Unexpected response status code: 500
Current downstream:                                           OK - Current Downstream: 0.76 Mbit/s | 'downstream_current'=0.763176;;;;
Current downstream usage:                                     UNKNOWN - Unexpected response status code: 500
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             UNKNOWN - Unexpected response status code: 500
Current upstream:                                             OK - Current Upstream: 0.55 Mbit/s | 'upstream_current'=0.554912;;;;
Current upstream usage:                                       UNKNOWN - Unexpected response status code: 500

--modelgroup Cable :

WAN connection status:                                        OK - Connection Status: Connected; External IP: xx.yyy.zzz.200
WAN connection uptime in seconds:                             OK - Connection Uptime: 125038 seconds (1d 10h 43m 58s) | 'uptime'=125038.000000s;;;;
Device uptime in seconds:                                     OK - Device Uptime: 125153 seconds (1d 10h 45m 53s) | 'uptime'=125153.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 1150.00 Mbit/s | 'downstream_max'=1150.000000;;;;
Current downstream:                                           OK - Current Downstream: 0.76 Mbit/s | 'downstream_current'=0.763176;;;;
Current downstream usage:                                     OK - 0.07% Downstream utilization (0.76 Mbit/s of 1150.00 Mbits) | 'downstream_usage'=0.066363;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 56.71 Mbit/s | 'upstream_max'=56.710000;;;;
Current upstream:                                             OK - Current Upstream: 0.55 Mbit/s | 'upstream_current'=0.554912;;;;
Current upstream usage:                                       OK - 0.98% Upstream utilization (0.55 Mbit/s of 56.71 Mbits) | 'upstream_usage'=0.978508;;;0.000000;100.000000

FRITZBox 6490 Cable via Lan1

--modelgroup DSL :

WAN connection status:                                        UNKNOWN - Unexpected response status code: 500
WAN connection uptime in seconds:                             UNKNOWN - Unexpected response status code: 500
Device uptime in seconds:                                     OK - Device Uptime: 85105 seconds (0d 23h 38m 25s) | 'uptime'=85105.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           UNKNOWN - Unexpected response status code: 500
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.000000;;;;
Current downstream usage:                                     UNKNOWN - Unexpected response status code: 500
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             UNKNOWN - Unexpected response status code: 500
Current upstream:                                             OK - Current Upstream: 0.00 Mbit/s | 'upstream_current'=0.000000;;;;
Current upstream usage:                                       UNKNOWN - Unexpected response status code: 500

--modelgroup Cable :

WAN connection status:                                        OK - Connection Status: Connected; External IP: xx.yyy.zzz.200
WAN connection uptime in seconds:                             OK - Connection Uptime: 85012 seconds (0d 23h 36m 52s) | 'uptime'=85012.000000s;;;;
Device uptime in seconds:                                     OK - Device Uptime: 85108 seconds (0d 23h 38m 28s) | 'uptime'=85108.000000s;;;;
Update state:                                                 OK - No update available
Maximum downstream:                                           OK - Max Downstream: 0.00 Mbit/s | 'downstream_max'=0.001024;;;;
Current downstream:                                           OK - Current Downstream: 0.00 Mbit/s | 'downstream_current'=0.000000;;;;
Current downstream usage:                                     OK - 0.00% Downstream utilization (0.00 Mbit/s of 0.00 Mbits) | 'downstream_usage'=0.000000;;;0.000000;100.000000
Current temperature of a radiator thermostat:                 UNKNOWN - a AIN needs to be set for this check method
Current power consumption of a socket switch:                 UNKNOWN - a AIN needs to be set for this check method
Total power consumption of the last year of a socket switch:  UNKNOWN - a AIN needs to be set for this check method
Current smart device connection status:                       UNKNOWN - a AIN needs to be set for this check method
Maximum upstream:                                             OK - Max Upstream: 0.10 Mbit/s | 'upstream_max'=0.099999;;;;
Current upstream:                                             OK - Current Upstream: 0.00 Mbit/s | 'upstream_current'=0.000000;;;;
Current upstream usage:                                       OK - 0.00% Upstream utilization (0.00 Mbit/s of 0.10 Mbits) | 'upstream_usage'=0.000000;;;0.000000;100.000000

@mcktr
Copy link
Owner Author

mcktr commented Sep 29, 2020

@uclara Wow thank you!

So there still is a problem with boxes that are connected via LAN1 to the internet. I'll have a look but I don't know if there is a solution for this.

I'll let you know :-)

Best regards
Michael

@mcktr
Copy link
Owner Author

mcktr commented Oct 9, 2020

I tried a lot of things in the last days to fix the LAN1 problem... unfortunately nothing worked out. I'll merge this PR and tag a new version but creating a follow-up issue to investigate further on the problem with a fresh mind. :-)

Best regards
Michael

@mcktr mcktr merged commit c84a679 into master Oct 9, 2020
@mcktr mcktr deleted the bugfix/wrong-values-up-downstream branch October 9, 2020 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong value for max upstream/downstream cable speed seems to be incorrectly reported
3 participants