Monitoring FritzBox with CheckMK

CMK version: 2.3.0.1
OS version: Ubuntu 22.04

Error message:

Agent exited with code 1: HTTPConnectionPool(host='10.11.56.1', port=49000): Max retries exceeded with url: /upnp/control/WANIPConn1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4b89760230>, 'Connection to 10.11.56.1 timed out. (connect timeout=10)'))
Traceback (most recent call last):
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connectionpool.py", line 715, in urlopen
httplib_response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connectionpool.py", line 416, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connection.py", line 244, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/omd/sites/cmk/lib/python3.12/http/client.py", line 1336, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/omd/sites/cmk/lib/python3.12/http/client.py", line 1382, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/omd/sites/cmk/lib/python3.12/http/client.py", line 1331, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/omd/sites/cmk/lib/python3.12/http/client.py", line 1091, in _send_output
self.send(msg)
File "/omd/sites/cmk/lib/python3.12/http/client.py", line 1035, in send
self.connect()
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connection.py", line 205, in connect
conn = self._new_conn()
^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connection.py", line 179, in _new_conn
raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPConnection object at 0x7f4b89760230>, 'Connection to 10.11.56.1 timed out. (connect timeout=10)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/cmk/lib/python3.12/site-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/connectionpool.py", line 799, in urlopen
retries = retries.increment(
^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.11.56.1', port=49000): Max retries exceeded with url: /upnp/control/WANIPConn1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4b89760230>, 'Connection to 10.11.56.1 timed out. (connect timeout=10)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/cmk/share/check_mk/agents/special/agent_fritzbox", line 11, in <module>
sys.exit(main())
^^^^^^
File "/omd/sites/cmk/lib/python3/cmk/special_agents/agent_fritzbox.py", line 205, in main
upnp_infos = list(_get_query_responses(connection, args.debug))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3/cmk/special_agents/agent_fritzbox.py", line 186, in _get_query_responses
yield get_upnp_info(*query, connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3/cmk/special_agents/agent_fritzbox.py", line 165, in get_upnp_info
response = _get_response(control, namespace, action, connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3/cmk/special_agents/agent_fritzbox.py", line 147, in _get_response
response = connection.post(*post_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3/cmk/special_agents/agent_fritzbox.py", line 129, in post
return self._session.post(
^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/requests/sessions.py", line 637, in post
return self.request("POST", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/omd/sites/cmk/lib/python3.12/site-packages/requests/adapters.py", line 507, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='10.11.56.1', port=49000): Max retries exceeded with url: /upnp/control/WANIPConn1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f4b89760230>, 'Connection to 10.11.56.1 timed out. (connect timeout=10)'))

Hey guys I’m trying to connect my fritzbox instance to CheckMK.
From what I saw it is trying to reach port 49000 which is not available on the device. (Since this device is managed by a 3rd party organisation). Is there a way to change the port to the correct http port and map it to the check?
Also when trying to accesss the /upnp/control/WANIPConn1 on the http port I’m still not seeing any information.
The CMK instance is running through a VPN and is trying to reach the routers, not sure if this is a going to be a problem, but I suspect if it’s hosted on a specific port.
Any ideas are appreciated.

The port 49000 is the upnp port. As far as i know you cannot change this port.

Do you know if the Upnp service should be available when scanning with nmap?

Yes, if the port is open, nmap should find it. But the port is not in the default nmap port range. You will have to specify the port when calling nmap:
nmap -p 49000
Ralf

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.