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

Query all sync groups on downstream_max/upstream_max #83

Closed
wants to merge 4 commits into from

Conversation

mcktr
Copy link
Owner

@mcktr mcktr commented Jun 12, 2020

Changes the downstream_max and upstream_max method to query all found
sync groups to ensure a correct calculated max down-/up-stream value.

ToDo

fixes #72

Changes the downstream_max and upstream_max method to query all found
sync groups to ensure a correct calculated max down-/up-stream value.

refs #72
@mcktr mcktr added bug Something is wrong needs-feedback Needs further information area/check/upstream area/check/downstream labels Jun 12, 2020
@mcktr mcktr added this to the 1.2.0 milestone Jun 12, 2020
@mcktr
Copy link
Owner Author

mcktr commented Jun 12, 2020

Example:

./check_fritz -H 192.168.178.1 -p *** -m downstream_max -w 115 -c 116
CRITICAL - Max Downstream: 114.11 Mbit/s, Downstream SyncGroup 'sync_dsl': 114.11 Mbit/s | 'downstream_max_sync_dsl'=114.110000;115.000000;116.000000;; 'downstream_max'=114.110000;115.000000;116.000000;;

./check_fritz -H 192.168.178.1 -p *** -m upstream_max
OK - Max Upstream: 34.96 Mbit/s, Upstream SyncGroup 'sync_dsl': 34.96 Mbit/s | 'upstream_max_sync_dsl'=34.957000;;;; 'upstream_max'=34.957000;;;;

@mcktr
Copy link
Owner Author

mcktr commented Jun 12, 2020

@uclara Can you have a look on this new PR please? :-) Freshly build binaries can be found here: https://github.com/mcktr/check_fritz/actions/runs/133478648

I changed the downstream_max and upstream_max functions to query all sync groups and calculate a combined max downstream/upstream value. The single values for each sync group will also be printed and is made available via PerformanceData to import it in a graphing tool like Grafana.

For now I wish you a nice weekend. ;-)

@uclara
Copy link

uclara commented Jun 21, 2020

@mcktr I installed the version you build 9 days ago. It's funny to see the combination of different sync groups, but I don't understand for what it should be used.
I tested with my FRITZ!Box 6591 Cable/FRITZ!OS: 07.13.

check_fritz reports for Max Downstream:
Bildschirmfoto 2020-06-21 um 22 01 13

check_fritz reports for Max Upstream:
Bildschirmfoto 2020-06-21 um 21 59 34

I use the LAN port to connect the FRITZ!Box to my LAN, and the Cable port ti connect to Vodafone Kabel/Deutschland. The sum of both ports does't make sense from my point of view and should be at least optional. Perhaps it is useful for scenarios in which two Internet uplinks are used in parallel, e.g. DSL or Cable + LTE USB stick, but I'm not sure that they can be used in parallel, but rather as active / passive. In this case, the sum would bring very little.

In my opinion it would be better to configure the sync groups individually as a service than in combination.

But maybe I didn't quite understand what you wanted to do with it :-)

PS:
It is also interesting that sync_lan0 is asymmetrical and displays 1024 Mbit/s in the downstream and only 99.999 Mbit/s in the upstream.
Maybe lan0 is not the ethernet interface to the LAN, but is it a virtual interface to the cable modem?

I'll take a look at my remaining FRITZ! Boxes with your test code in the next few days, maybe I'll find something ...

Ulli

@mcktr
Copy link
Owner Author

mcktr commented Jun 29, 2020

@uclara The problem here is that there is no way (that I know of) to query a sync group via an permanent identifier. There is an ongoing number or the name that you can use to identify the sync group, both can change after a reboot, update or even on a reconnect. Using one of of this as an identifier and a change happens this would mess with the configured service in your monitoring solution.

How about an additional parameter to set a ignore list of sync groups that will be skipped when querying?

Did you notice any other issues in this regard with your other Fritz!Box devices?

Thanks!
Michael

@uclara
Copy link

uclara commented Jul 10, 2020

@mcktr the idea sounds good, maybe with a similar tool like the "getSecurityPort" that was used with check_tr64_fritz to get the port number for the FRITZ!Box. In that way everybody can see what's available via the API and configure what's needed. Maybe the default behaviour should stay as it is today in the stable version.

Otherwise, I have unfortunately found nothing else, because at the moment I am struggling with the configuration of the services for the various FRITZ! Boxes. I would like to show related services together under the host. I can remember that something was possible in Nagios by using a second attribute for sorting. You could use a number to arrange the order of the services as you like - is that also possible with Icinga2?

PS: I use Consol Labs OMD with Icinga2 as core and Thruk as frontend

@mcktr
Copy link
Owner Author

mcktr commented Jul 13, 2020

@mcktr the idea sounds good, maybe with a similar tool like the "getSecurityPort" that was used with check_tr64_fritz to get the port number for the FRITZ!Box.

Thanks for that suggestion @uclara, but is such a tool really necessary if we went with a ignore list for sync groups? You can run the check plugin once and see all sync groups, now you can set the appropriate ignore list entries. Nonetheless this should be well documented.

In that way everybody can see what's available via the API and configure what's needed. Maybe the default behaviour should stay as it is today in the stable version.

The default behavior in the current stable version does not respect cable sync groups since on a cable connection you have two sync groups. If you are lucky and the cable sync group has the id 0 you'll get the correct down-/upstream, if the lan sync group has id 0 you'll get wrong values. Im also not happy with changing the default behavior but I see no other way to implement this in a sane way other than with this PR. If the sync group had permanent identifiers this would be more less complicated to find a sane solution, but they haven't. :-(

I would like to show related services together under the host. I can remember that something was possible in Nagios by using a second attribute for sorting. You could use a number to arrange the order of the services as you like - is that also possible with Icinga2?

Sorry I don't know Nagios or Thruk only Icinga Web 2. In Icinga Web 2 you have a host overview, if you click on the host you have the services related to this host in alphabetical order.

Best regards
Michael

@mcktr mcktr self-assigned this Jul 13, 2020
@uclara
Copy link

uclara commented Jul 14, 2020

@mcktr: I agree with you.
Maybe it would be possible to get in contact with AVM developers in the future to exchange ideas and suggestions regarding their FRITZ!OS API. Unfortunately I haven't any contacts ...

Regarding the sorting of the services I will get a try to Icinga Web 😄

Ulli

Implementing a new CLI parameter to set a ignore list for sync groups
that are used in the CheckUpstreamMax and CheckDownstreamMax functions.
@mcktr
Copy link
Owner Author

mcktr commented Aug 31, 2020

Hello @uclara,

sorry that my response is so late. I had a couple of personal things to sort out. I'll try to be more active again from now on.

I implemented the mentioned ignore list for sync groups, can you may give it a try to see if this fits your needs? :-)

An example:

.\check_fritz -H 192.168.178.1 -p secret -m upstream_max --ignoresyncgroups "sync_dsl,cable_lan"

The --ignoresyncgroups sets the sync groups you don't want to consider in the final output. You can find freshly build binaries here: https://github.com/mcktr/check_fritz/actions/runs/232521527

I'm looking forward to your feedback.

Best regards
Michael

@dirkpauli
Copy link

just downloaded the latest version. My Fritzbox 6591 is running Fritz!OS 7.21 now. When running
check_fritz -H -u -p --modelgroup Cable -m upstream_max
I get an panic error:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7716fd]

goroutine 1 [running]:
main.isInIgnoreList(0x0, 0xc00000a1b0, 0xa, 0x1)
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:86 +0x2d
main.CheckUpstreamMax(0xc000139c50, 0xc000139c10, 0xc000139c00, 0xc000139c20, 0xc000139c40, 0x0, 0x0, 0x0, 0xc000139bd0, 0xc000139c30, ...)
D:/a/check_fritz/check_fritz/cmd/check_fritz/check_upstream.go:80 +0xc36
main.checkMain(0xc000090c80, 0xc0000a7400, 0x18)
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:194 +0x5c0
github.com/urfave/cli/v2.(*App).RunContext(0xc000084600, 0x8c20e0, 0xc0000b0188, 0xc0000e2000, 0xb, 0x10, 0x0, 0x0)
C:/Users/runneradmin/go/pkg/mod/github.com/urfave/cli/v2@v2.2.0/app.go:315 +0x712
github.com/urfave/cli/v2.(*App).Run(...)
C:/Users/runneradmin/go/pkg/mod/github.com/urfave/cli/v2@v2.2.0/app.go:215
main.main()
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:334 +0xb4b

here the complete output with debug activated:

Frist SOAP Response:

<TITLE>401 Unauthorized (ERR_NONE)</TITLE>

401 Unauthorized


ERR_NONE
Webserver Mon, 14 Sep 2020 19:38:20 GMT

Second SOAP Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM-DE_GetOnlineMonitorResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
2
sync_cable
CABLE
<Newmax_ds>804169650</Newmax_ds>
<Newmax_us>48404628</Newmax_us>
<Newds_current_bps>25,440,52,77,0,134,98,5402,89,0,0,54,134,40,69,0,0,69,11,30</Newds_current_bps>
<Newmc_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newmc_current_bps>
<Newus_current_bps>25,483,61,122,2,581,152,1846,62,0,1,109,191,212,99,32,65,131,66,2788</Newus_current_bps>
<Newprio_realtime_bps>25,483,61,122,2,581,152,1846,62,0,1,109,191,212,99,32,65,131,66,2788</Newprio_realtime_bps>
<Newprio_high_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_high_bps>
<Newprio_default_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_default_bps>
<Newprio_low_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_low_bps>
</u:X_AVM-DE_GetOnlineMonitorResponse>
</s:Body>
</s:Envelope>


Frist SOAP Response:

<TITLE>401 Unauthorized (ERR_NONE)</TITLE>

401 Unauthorized


ERR_NONE
Webserver Mon, 14 Sep 2020 19:38:20 GMT

Second SOAP Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM-DE_GetOnlineMonitorResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
2
sync_lan0
ATA
<Newmax_ds>0</Newmax_ds>
<Newmax_us>0</Newmax_us>
<Newds_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newds_current_bps>
<Newmc_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newmc_current_bps>
<Newus_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newus_current_bps>
<Newprio_realtime_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_realtime_bps>
<Newprio_high_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_high_bps>
<Newprio_default_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_default_bps>
<Newprio_low_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_low_bps>
</u:X_AVM-DE_GetOnlineMonitorResponse>
</s:Body>
</s:Envelope>

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x7716fd]

goroutine 1 [running]:
main.isInIgnoreList(0x0, 0xc0000a6820, 0xa, 0x1)
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:86 +0x2d
main.CheckUpstreamMax(0xc000165c50, 0xc000165c10, 0xc000165c00, 0xc000165c20, 0xc000165c40, 0x0, 0x0, 0x0, 0xc000165bd0, 0xc000165c30, ...)
D:/a/check_fritz/check_fritz/cmd/check_fritz/check_upstream.go:80 +0xc36
main.checkMain(0xc00004ec80, 0xc000005500, 0x18)
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:194 +0x5c0
github.com/urfave/cli/v2.(*App).RunContext(0xc00003af00, 0x8c20e0, 0xc00000a1e0, 0xc00010c000, 0xc, 0x10, 0x0, 0x0)
C:/Users/runneradmin/go/pkg/mod/github.com/urfave/cli/v2@v2.2.0/app.go:315 +0x712
github.com/urfave/cli/v2.(*App).Run(...)
C:/Users/runneradmin/go/pkg/mod/github.com/urfave/cli/v2@v2.2.0/app.go:215
main.main()
D:/a/check_fritz/check_fritz/cmd/check_fritz/main.go:334 +0xb4b

@dirkpauli
Copy link

if I add the -ignoresysncgroups parameter, the panic disappears, but the values given are not correct (6433 Mbits instead of about 50 MBits for example)

@mcktr
Copy link
Owner Author

mcktr commented Sep 15, 2020

Hi @dirkpauli

first of all thanks for testing this PR! I fixed the issue with the nil pointer dereference, this was indeed a programming mistake.

Can you please re-test the fixed version? You can find the fixed version here:
https://github.com/mcktr/check_fritz/actions/runs/256111155

if I add the -ignoresysncgroups parameter, the panic disappears, but the values given are not correct (6433 Mbits instead of about 50 MBits for example)

Can you please share the exact plugin call and the exact plugin output here? (hide credentials nonetheless)

Thanks!
Michael

@dirkpauli
Copy link

dirkpauli commented Sep 24, 2020 via email

@dirkpauli
Copy link

sorry, oversaw that I was'nt logged on.

check_fritz -H -u -p --modelgroup cable -m downstream_usage
OK - 0.00% Downstream utilization (0.00 Mbit/s of 6792.21 Mbits) | 'downstream_usage'=0.000000;;;0.000000;100.000000

@dirkpauli
Copy link

`check_fritz -H -u -p --modelgroup cable -m downstream_usage -d

Frist SOAP Response:

<TITLE>401 Unauthorized (ERR_NONE)</TITLE>

401 Unauthorized


ERR_NONE
Webserver Thu, 24 Sep 2020 19:28:49 GMT

Second SOAP Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM-DE_GetOnlineMonitorResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
2
sync_cable
CABLE
<Newmax_ds>849026109</Newmax_ds>
<Newmax_us>793700759</Newmax_us>
<Newds_current_bps>165,10483,149,171,21162,41,0,159,126,804,88,833,500,2107,136,3538,377,102,22,43</Newds_current_bps>
<Newmc_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newmc_current_bps>
<Newus_current_bps>219,2053,334640,219,5330,907,0,937,159,634,158,642,521,755,193,974,136,298892,6400,574</Newus_current_bps>
<Newprio_realtime_bps>219,2053,334640,219,5330,907,0,937,159,634,158,642,521,755,193,974,136,298892,6400,574</Newprio_realtime_bps>
<Newprio_high_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_high_bps>
<Newprio_default_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_default_bps>
<Newprio_low_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_low_bps>
</u:X_AVM-DE_GetOnlineMonitorResponse>
</s:Body>
</s:Envelope>

OK - 0.00% Downstream utilization (0.00 Mbit/s of 6792.21 Mbits) | 'downstream_usage'=0.000019;;;0.000000;100.000000`

@mcktr
Copy link
Owner Author

mcktr commented Sep 24, 2020

@dirkpauli This PR is about the methods upstream_max and downstream_max can you run these methods?

@dirkpauli
Copy link

that makes no difference at all,
anyway:
check_fritz -H -u -p --modelgroup cable -m downstream_max -d


Frist SOAP Response:

<TITLE>401 Unauthorized (ERR_NONE)</TITLE>

401 Unauthorized


ERR_NONE
Webserver Thu, 24 Sep 2020 19:34:14 GMT

Second SOAP Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM-DE_GetOnlineMonitorResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
2
sync_cable
CABLE
<Newmax_ds>849026109</Newmax_ds>
<Newmax_us>793700759</Newmax_us>
<Newds_current_bps>362,520,195,275,261,92,475,109,261,200,953,682,172,401,234,380,746,235,986,535</Newds_current_bps>
<Newmc_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newmc_current_bps>
<Newus_current_bps>160,479,111,381,387,131,329119,6878,233,686,3289,5853,178,3708,939,3569,563,357,1043,564</Newus_current_bps>
<Newprio_realtime_bps>160,479,111,381,387,131,329119,6878,233,686,3289,5853,178,3708,939,3569,563,357,1043,564</Newprio_realtime_bps>
<Newprio_high_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_high_bps>
<Newprio_default_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_default_bps>
<Newprio_low_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_low_bps>
</u:X_AVM-DE_GetOnlineMonitorResponse>
</s:Body>
</s:Envelope>


Frist SOAP Response:

<TITLE>401 Unauthorized (ERR_NONE)</TITLE>

401 Unauthorized


ERR_NONE
Webserver Thu, 24 Sep 2020 19:34:14 GMT

Second SOAP Response:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<u:X_AVM-DE_GetOnlineMonitorResponse xmlns:u="urn:dslforum-org:service:WANCommonInterfaceConfig:1">
2
sync_lan0
ATA
<Newmax_ds>0</Newmax_ds>
<Newmax_us>0</Newmax_us>
<Newds_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newds_current_bps>
<Newmc_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newmc_current_bps>
<Newus_current_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newus_current_bps>
<Newprio_realtime_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_realtime_bps>
<Newprio_high_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_high_bps>
<Newprio_default_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_default_bps>
<Newprio_low_bps>0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0</Newprio_low_bps>
</u:X_AVM-DE_GetOnlineMonitorResponse>
</s:Body>
</s:Envelope>

OK - Max Downstream: 6792.21 Mbit/s, Downstream SyncGroup 'sync_cable': 6792.21 Mbit/s, Downstream SyncGroup 'sync_lan0': 0.00 Mbit/s | 'downstream_max_sync_cable'=6792.208872;;;; 'downstream_max_sync_lan0'=0.000000;;;; 'downstream_max'=6792.208872;;;;

grafik

@mcktr
Copy link
Owner Author

mcktr commented Sep 24, 2020

Can you please show me the graphs from the Fritz!Box interface?

image

@dirkpauli
Copy link

here we go:
grafik

@mcktr
Copy link
Owner Author

mcktr commented Sep 24, 2020

Thanks @dirkpauli! I really appreciate your help! 👍

I think I now know whats going on here. The methods downstream_max, downstream_usage and the upstream equivalents uses the following information to calculate the max up-/downstream.

<Newmax_ds>849026109</Newmax_ds>
<Newmax_us>793700759</Newmax_us>

It seems to be that this information is not the max link upstream/downstream, but the max measured upstream/downstream. I can see the same behavior on my DSL Fritz!Box. Still, I don't have a clue why the values are that high on your Fritz!Box.

I need to change the information source for the mentioned functions to use the correct value for upstream/downstream. This will take some time, I'll look into it over the weekend. Can you come back on monday and have a look for an update here? :-)

@mcktr mcktr assigned mcktr and unassigned uclara and mcktr Sep 24, 2020
@mcktr mcktr removed the needs-feedback Needs further information label Sep 24, 2020
@dirkpauli
Copy link

dirkpauli commented Sep 25, 2020 via email

@mcktr
Copy link
Owner Author

mcktr commented Sep 25, 2020

Hi @dirkpauli,

thanks for the input. Can you do me a favor and run the following script? The script has two purposes, 1: It should output all available TR-064 services (meaning list all available information sources we can query using the TR-064 protocol), 2: output the information from one specific TR-064 service called WANDSLInterfaceConfig.

#!/usr/bin/env bash

HOSTNAME="fritz.box"
PORT="49443"
USERNAME="dslf-config"

while getopts h:p:u:P:U:s:a:x: OPTNAME; do
  case "${OPTNAME}" in
  h)
    HOSTNAME="${OPTARG}"
    ;;
  p)
    PORT="${OPTARG}"
    ;;
  u)
    USERNAME="${OPTARG}"
    ;;
  P)
    PASSWORD="${OPTARG}"
    ;;
  U)
    url="${OPTARG}"
    ;;
  s)
    service="${OPTARG}"
    ;;
  a)
    action="${OPTARG}"
    ;;
  x)
    xmlVar="${OPTARG}"
    ;;
  *)
    echo "fetch_tr64_data.sh -h <HOST> -p <PORT> -u <USER> -P <PASSWORD> -U <URL> -s <SERVICE> -a <ACTION> -x <xmlVar>"
    exit 0
    ;;
  esac
done

echo ""
echo ""
echo "${HOSTNAME}"
echo "${PORT}"
echo "${USERNAME}"
echo "${url}"
echo "${service}"
echo "${action}"
echo "${xmlVar}"
echo ""
echo ""


queryResult=$(curl "https://${HOSTNAME}:${PORT}/tr64desc.xml" \
-k \
-s \
-u "${USERNAME}:${PASSWORD}" \
--anyauth \
-H "Content-Type: text/xml; charset='utf-8'" \
)

echo "${queryResult}"
echo ""
echo ""

queryResult=$(curl "https://${HOSTNAME}:${PORT}/upnp/control/${url}" \
-k \
-s \
-u "${USERNAME}:${PASSWORD}" \
--anyauth \
-H "Content-Type: text/xml; charset='utf-8'" \
-H "SOAPACTION: urn:dslforum-org:service:${service}:1#${action}" \
-d "<?xml version='1.0'?> <s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/' s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <s:Body> <u:${action} xmlns:u='urn:dslforum-org:service:${service}:1'> ${xmlVar} </u:${action}> </s:Body> </s:Envelope>"
)

echo "${queryResult}"

Just copy this script on your Linux host and save it as script.sh for example, afterwards run this command to make it executable:

chmod +x script.sh

Now you can run the script:

./script.sh -P yourpassword -U "wandslifconfig1" -s "WANDSLInterfaceConfig" -a "GetInfo"

Please use the same values for -U -s -a since this tells the script which TR-064 service should be called. You can use -h to define your Fritz!Box address, -u for your user and -P is your password.

Please share the whole output here. If you are worried about exposing sensitive information to the public you can email me directly using my GitHub email, should be visible on the left side if you are logged in.

I already found a way how to query the correct value using a DSL Fritz!Box. With this step I'll verify if this would also work on a cable Fritz!Box.

Thanks a lot!

Best regards
Michael

@dirkpauli
Copy link

dirkpauli commented Sep 27, 2020 via email

@mcktr mcktr removed this from the 1.2.0 milestone Oct 6, 2020
@mcktr
Copy link
Owner Author

mcktr commented Oct 6, 2020

Closed in favor of #97

@mcktr mcktr closed this Oct 6, 2020
@mcktr mcktr removed their assignment Oct 9, 2020
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.

cable speed seems to be incorrectly reported
3 participants