I am using the agent_fritzbox to get some statistics from my AVM FRITZ!Box 7590. I already added the Fritzbox as a host and added a rule at Setup → Agents → Other Integrations → Fritz!Box Devices in order to enable the fritzbox agent. So far, everything is up and running:
However, I’m only getting the “Configuration” and “Connection” services while I’m mostly interested in the “fritz_wan_if” plugin to get some stats about the WAN interface.
This is a known “Bug” inside the discovery function and the translation of the data to a generic interface check.
If your box is connected to the WAN/LAN ports and not the DSL then this is normal.
I will attach the diff for the file ~/lib/check_mk/base/plugins/agent_based/fritz.py to detect also these interfaces.
--- /omd/sites/home/lib/check_mk/base/plugins/agent_based/fritz.py 2021-10-05 13:03:21.000000000 +0200
+++ /omd/sites/home/local/lib/check_mk/base/plugins/agent_based/fritz.py 2021-08-27 08:28:59.531453277 +0200
@@ -86,4 +86,7 @@
link_stat = section.get('NewLinkStatus')
if not link_stat:
+ link_stat = section.get('NewPhysicalLinkStatus')
+
+ if not link_stat:
oper_status = '4'
elif link_stat == 'Up':
Don’t edit this file - my diff was showing the right location →
I think you made some mistakes with editing this file as the parsed output is a list and should be a dictionary.
You need to replace the “fritz.py” file with a unmodified version from before.
Ok, thanks for the hints again. I just replaced the /omd/sites/testrechner/lib/check_mk/base/plugins/agent_based/fritz.py with a new one. (I did a “compare” in Notepad++ with NO DIFFERENCES. A sha512sum was different, though. For whatever reason.) My “Configuration” and “Connection” is now working again.
But: How can I do the changes you supposed with your diff? At /omd/sites/testrechner/local/lib/check_mk/base/plugins/agent_based/ are no files. I just copied the fritz.py into this folder and edited it. However, the only thing remaining is a “pycache” folder with a file “fritz.cpython-38.pyc”.
I feel like a total newbie Sorry for that…
Thanks
Johannes
Copy the fritz.py to the local location and then make the change.
Very important is the right indentation.
Your output from the error shows that your Fritzbox only has the “NewPhysicalLinkStatus” and not the old “NewLinkStatus”. My modification should work if applied correctly.
Hm, for some reason I encounter another problem. While the the “Interface 0” counters are still correct and refreshed every minute, I am seeing this errors since about 3 hours:
I just did the “copy, add-the-lines, move” trick again and now it’s working without errors again. Let’s see whether the same error appears tomorrow again.
The only thing I noticed was that the “fritz.py” file within the /omd/sites/nuc01/local/lib/check_mk/base/plugins/agent_based was gone in the meantime. Shouldn’t it remain in this folder?
Furthermore, note that I am using distributed monitoring, while this Fritzbox check is done at the remote site. Could this be correlated to the problems? Should I change the original fritz.py at the main checkmk site as well?
Yes - you need to copy and modify the file on the central site.
The central site pushes the complete content to the remote sites and removes every change there.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.