2.0.0p6 RAW - can not locate "Datasource programs > Check state of VMWare ESX via vSphere"

Sorry for my delay.

@andreas-doehler I had created a different post here about the permissions for vSphere (2.0.0.p6 RAW to monitor VMs / vSphere) and from the answers there I assumed I only needed a read only account in vSphere. Thats my fault. I will try and add a read only to the host system. Will update shortly. Thank you.

@andreas-doehler @lkoenig @martin.schwarz
Some progress.
Update:

Agent exited with code 1: HTTPSConnectionPool(host='esxi1', port=443): Max retries exceeded with url: /sdk (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9c06220df0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Traceback (most recent call last):
File "/omd/sites/checkmk/lib/python3/urllib3/connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "/omd/sites/checkmk/lib/python3/urllib3/util/connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/omd/sites/checkmk/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/checkmk/lib/python3/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/omd/sites/checkmk/lib/python3/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/omd/sites/checkmk/lib/python3/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/omd/sites/checkmk/lib/python3/urllib3/connection.py", line 309, in connect
conn = self._new_conn()
File "/omd/sites/checkmk/lib/python3/urllib3/connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f9c06220df0>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/checkmk/lib/python3/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/omd/sites/checkmk/lib/python3/urllib3/connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "/omd/sites/checkmk/lib/python3/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='esxi1', port=443): Max retries exceeded with url: /sdk (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9c06220df0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_vsphere.py", line 1908, in main
esx_connection = ESXConnection(opt.host_address, opt.port, opt)
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_vsphere.py", line 1081, in __init__
self.system_info = self._fetch_systeminfo()
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_vsphere.py", line 1103, in _fetch_systeminfo
response = self._session.postsoap(SoapTemplates.SYSTEMINFO)
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_vsphere.py", line 1048, in postsoap
return super(ESXSession, self).post(self._post_url, data=soapdata, verify=self.verify)
File "/omd/sites/checkmk/lib/python3/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/omd/sites/checkmk/lib/python3/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/omd/sites/checkmk/lib/python3/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/omd/sites/checkmk/lib/python3/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='esxi1', port=443): Max retries exceeded with url: /sdk (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9c06220df0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/omd/sites/checkmk/share/check_mk/agents/special/agent_vsphere", line 12, in <module>
sys.exit(main())
File "/omd/sites/checkmk/lib/python3/cmk/special_agents/agent_vsphere.py", line 1922, in main
return 0 if opt.agent else 1
AttributeError: 'Namespace' object has no attribute 'agent'

In the screenshots we saw above the host was named “TestHost1”. The output you are showing is for a host called “esxi1”. It looks like that is not a hostname that is resolved by dns, so you are getting the Name or service not known error.
Which command did you run to get that output and did you change the name of you ESX host in the webinterface?
If you ESX host is still called “TestHost1” in checkmk, please try to run cmk --debug -nvv TestHost1 as the site user and see if that spits out an error.

@lkoenig
I should have clarified. I don’t often post on forums so I wasn’t thinking from the troubleshooting perspective.

DNS isn’t up to date here so I’ve been using IP addresses a lot. Especially for agents on Windows machines.

“TestHost1” was being used during testing but today that was removed and attempts are being made to add the host under a new host entry called “esxi1”.

That output is a direct copy and paste form the Agent results in the connection test to the host.

Can you once again run cmk -D esxi1 ? It seems the special agent is not picking up the IP-address of the host and trying the hostname.

1 Like

@lkoenig

Please check if you have any pending changes or just do a cmk -R on the commandline and check if the output of cmk -D still looks the same. It looks like the rule for the special agent does not see that the host has a specific IP-address configured.
I just created a rule in my test-site and it picks up the IP-address as expected. You could also just delete the rule you already have and create a new one, maybe then the IP-address is being set correctly in the agent-call.

1 Like

@lkoenig
I deactivated SSL and the connection to the esxi host is now working.

I am not sure who to credit - with so many people helping.

Thank you.

2 Likes

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.