MaximilianClemens / checkmk_fritzbox

Extended CheckMK FritzBox Agent for SmartHome Devices.
GNU General Public License v2.0
10 stars 3 forks source link

Check fails after upgrade to fritz os 7.25 #3

Closed edu8 closed 3 years ago

edu8 commented 3 years ago

First of all thanks for the great check. This is exactly what i was searching for and it worked well for a long while until now. I upgraded my Fritz!Box 6490 to 7.25 from 7.20. After that the check fails with this output "UNKN - check failed - please submit a crash report!" image

When clicking on the ? I get the following.

Local Variables {'check_status': 0, 'device': None, 'devices': {}, 'info': [], 'item': u'17 Thermostat Kche Heizung', 'msg_data': [], 'params': {'hkr': {'hkr_crit': {'hkr_bat_below': 5, 'hkr_diff_soll': 5, 'hkr_flags': ('Max recursion depth reached', 'Max recursion depth reached', 'Max recursion depth reached')}, 'hkr_warn': {'hkr_bat_below': 15, 'hkr_diff_soll': 3, 'hkr_flags': ('Max recursion depth reached', 'Max recursion depth reached', 'Max recursion depth reached')}}, 'powermeter': {}, 'present': 2, 'switch': {}, 'temperature': {}}, 'perf_data': [], 'pparams': {'hkr': {'hkr_crit': {'hkr_bat_below': 5, 'hkr_diff_soll': 5, 'hkr_flags': ('Max recursion depth reached', 'Max recursion depth reached', 'Max recursion depth reached')}, 'hkr_warn': {'hkr_bat_below': 15, 'hkr_diff_soll': 3, 'hkr_flags': ('Max recursion depth reached', 'Max recursion depth reached', 'Max recursion depth reached')}}, 'powermeter': {}, 'present': 2, 'switch': {}, 'temperature': {}}}

If anything else is needed, I could provide it.

MaximilianClemens commented 3 years ago

Hi @edu8, thanks for the feedback. :)

Can you upload the agent output and the crash report: grafik

grafik

Regards Max

edu8 commented 3 years ago

Hi Max,

thanks for your reply. Sure thing I can offer these informations. I masked the IP adresses in the output.

This is the agent output:

<<>> VersionOS 141.07.25 VersionDevice AVM FRITZ!Box 6490 Cable NewVoipDNSServer1 x.x.x.x NewDNSServer2 x.x.x.x NewDNSServer1 x.x.x.x NewVoipDNSServer2 x.x.x.x NewIdleDisconnectTime 0 NewLayer1DownstreamMaxBitRate 337920000 NewWANAccessType Cable NewByteSendRate 17037 NewPacketReceiveRate 0 NewConnectionStatus Connected NewRoutedBridgedModeBoth 1 NewUptime 50921 NewTotalBytesReceived 776544285 NewX_AVM_DE_TotalBytesSent64 1890107672 NewPhysicalLinkStatus Up NewLinkStatus Up NewX_AVM_DE_WANAccessType Cable NewPacketSendRate 0 NewUpnpControlEnabled 0 NewLayer1UpstreamMaxBitRate 20992000 NewTotalBytesSent 1890107672 NewLastConnectionError ERROR_NONE NewAutoDisconnectTime 0 NewExternalIPAddress x.x.x.x NewLinkType PPPoA NewByteReceiveRate 658682 NewX_AVM_DE_TotalBytesReceived64 13661446173

This is the crash report: Check_MK_Crash_FritzBox.local_SmartDevice+18+Thermostat+Wohnzimmer+Heizung_2021-03-31_21-04-26.tar.gz

I forgot to mention I used version 0.41 until the error and updated to 0.51 of your check today by just following the same steps to install. CheckMK is currently on version 1.6.0p22 as I'm not sure that everything will work in the 2.* environment.

Regards Edu8

MaximilianClemens commented 3 years ago

Thanks for the output, normally it should contain a section beginning with <<<fritzbox_smarthome>>>. So I think it may not use the special agent correctly.

Can you please check some points for me:

  1. Open the Properties of the host and set DATA SOURCES > Check_MK Agent to "No Checkmk agent, all configured special agents" grafik

  2. Open the rulesets for the special agent: grafik Please check that the settings match your enviroment: grafik Does Hostname and Folder exactly fits? May try "Ignore SSL errors" if you access the fritz.box over https

  3. Can you check that the Credentails you entered in the rule works: grafik

  4. If this all don't help, can you try a manual agent call over the shell? su - <omdsitename> ~/local/share/check_mk/agents/special/agent_fritzbox_smarthome --debug --username <fritz-username> --password <fritz-password> <fritz-ip> > /tmp/sample.out or this if you access it over https ~/local/share/check_mk/agents/special/agent_fritzbox_smarthome --ignore_ssl --protocol <protocol: http or https> --debug --port <fritz-port> --username <fritz-username> --password <fritz-password> <fritz-ip> > /tmp/sample.out

and upload the file from /tmp/sample.out. Attention: The command above requires the password in cleartext so it will be stored in your shell history (for example at ~/.bash_history). You may want to clear it after the test

MaximilianClemens commented 3 years ago

Ah I may found something, are you using username + password or just password login?

The Login has changed with 7.25 so If you use Login with Password only it would fail. I have to do some changes in the agent for it (Link to the Doc)

edu8 commented 3 years ago

Hi Max,

thanks for getting back to me. When navigating to this issue I saw that you opened a new issue stating that avm took away the login without username. That's exactly what i was doing. So I created a new user in the Fritz!Box and updated my config in checkmk and that did the trick. It's working again like a charm. :)

Thanks a lot for your support.

May I suggest another feature? I have a lot of thermostats monitored. They always show the current temperature and the "Should temperature". When the battery runs low it also shows this in the output. It would be nice, if the state of the battery would be shown in any case to get an overview which battery might run low in the near future.

Regards Edu8

MaximilianClemens commented 3 years ago

Hi @edu8,

can you check v0.5.3. I make username and password required now and I added Flag for showing the battery state: grafik grafik

Regards Maximilian

edu8 commented 3 years ago

Hi @MaximilianClemens,

that was quick. Thanks for the effort. It works perfectly.

Regards Edu8