CMK version:
2.1.0p11
OS version:
Ubuntu 20.04 LTS
Description of the problem :
The vsphere special check receives a timeout if we use an IP instead of a FQDN on the command line. “In the webinterface” this only happens after a certain amount of time, round about 60 minutes, after a checkmk restart.
Since checkmk apparently internally only uses IPs this problem occurs again and again. We are also confused about the proxy in the error message since this should not matter using IP or FQDN?
Error message and/or output from below commands:
# Timeout:
./agent_vsphere '-u' 'svc_checkmk' '-sPassword' 'virtualmachine,datastore,counters,licenses' '-P' '--spaces' 'underscore' '--snapshots-on-host' '--no-cert-check' 'xx.xx.xx.xx' --debug
# Works:
./agent_vsphere '-u' 'svc_checkmk' '-sPassword' 'virtualmachine,datastore,counters,licenses' '-P' '--spaces' 'underscore' '--snapshots-on-host' '--no-cert-check' 'FQDN' --debug
# Detailed error message:
./agent_vsphere '-u' 'svc_checkmk' '-spassword' '-i' 'virtualmachine,datastore,counters,licenses' '-P' '--spaces' 'underscore' '--snapshots-on-host' '--no-cert-check' 'IP:xx.xx.xx.xx' --debug
Traceback (most recent call last):
File "/omd/sites/site/lib/python3.9/site-packages/urllib3/connectionpool.py", line 696, in urlopen
self._prepare_proxy(conn)
File "/omd/sites/site/lib/python3.9/site-packages/urllib3/connectionpool.py", line 964, in _prepare_proxy
conn.connect()
File "/omd/sites/site/lib/python3.9/site-packages/urllib3/connection.py", line 371, in connect
self._tunnel()
File "/omd/sites/site/lib/python3.9/http/client.py", line 930, in _tunnel
raise OSError(f"Tunnel connection failed: {code} {message.strip()}")
OSError: Tunnel connection failed: 504 Gateway Time-out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/omd/sites/site/lib/python3.9/site-packages/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/omd/sites/site/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/omd/sites/site/lib/python3.9/site-packages/urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='IP:xx.xx.xx.xx', port=443): Max retries exceeded with url: /sdk (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Time-out')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/omd/versions/2.1.0p11.cre/share/check_mk/agents/special/./agent_vsphere", line 13, in <module>
sys.exit(main())
File "/omd/sites/site/lib/python3/cmk/special_agents/agent_vsphere.py", line 2009, in main
esx_connection = ESXConnection(opt.host_address, opt.port, opt)
File "/omd/sites/site/lib/python3/cmk/special_agents/agent_vsphere.py", line 1126, in __init__
self.system_info = self._fetch_systeminfo()
File "/omd/sites/site/lib/python3/cmk/special_agents/agent_vsphere.py", line 1148, in _fetch_systeminfo
response = self._session.postsoap(SoapTemplates.SYSTEMINFO)
File "/omd/sites/site/lib/python3/cmk/special_agents/agent_vsphere.py", line 1090, in postsoap
return super().post(self._post_url, data=soapdata, verify=self.verify)
File "/omd/sites/site/lib/python3.9/site-packages/requests/sessions.py", line 577, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/omd/sites/site/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/omd/sites/site/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/omd/sites/site/lib/python3.9/site-packages/requests/adapters.py", line 513, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='IP:xx.xx.xx.xx', port=443): Max retries exceeded with url: /sdk (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 504 Gateway Time-out')))