Having issues when adding Vcenter

Hi all,
I’m new at this, so I apologize if there is something obvious that I’ve missed.
The plan is to run the Enterprise version for about 60 or so devices. But I stumbled early on.
I added my first host with an agent (SELUCMK01), discovered all the services, saved and all good!!.
Then I added my vcenter as described in the documentation. Discovered services and it looks fine. Can see all the vm’s. But now all the services discovered by the agent have vanished. Instead I get the error below. Apparently it tries to get the host info by using https to the IP of the host instead of agent.
What have I missed ?

CMK version: 2.0.0 p23
OS version: Ubuntu 20.04.4 LTS

Error message:
`
Cannot update tree(!), Found 1 inventory entries, [special_vsphere] Agent exited with code 1: HTTPSConnectionPool(host=‘xx.xx.xx.x’, port=443): Max retries exceeded with url: /sdk (Caused by NewConnectionError(’: Failed to establish a new connection: [Errno 111] Connection refused’))(!!)

**Output of “cmk --debug -vvn hostname”:** (If it is a problem with checks or plugins)
OMD[selu]:~$ cmk --debug -vvn SELUCMK01
Checkmk version 2.0.0p23
Try license usage history update.
Trying to acquire lock on /omd/sites/selu/var/check_mk/license_usage/next_run
Got lock on /omd/sites/selu/var/check_mk/license_usage/next_run
Trying to acquire lock on /omd/sites/selu/var/check_mk/license_usage/history.json
Got lock on /omd/sites/selu/var/check_mk/license_usage/history.json
Next run time has not been reached yet. Abort.
Releasing lock on /omd/sites/selu/var/check_mk/license_usage/history.json
Released lock on /omd/sites/selu/var/check_mk/license_usage/history.json
Releasing lock on /omd/sites/selu/var/check_mk/license_usage/next_run
Released lock on /omd/sites/selu/var/check_mk/license_usage/next_run
Loading autochecks from /omd/sites/selu/var/check_mk/autochecks/SELUCMK01.mk
+ FETCHING DATA
  Source: SourceType.HOST/FetcherType.PROGRAM
[cpu_tracking] Start [7********0]
[ProgramFetcher] Fetch with cache settings: DefaultAgentFileCache(base_path=PosixPath('/omd/sites/selu/tmp/check_mk/data_source_cache/special_vsphere/SELUCMK01'), max_age=MaxAge(checking=0, discovery=120, inventory=120), disabled=False, use_outdated=False, simulation=False)
Not using cache (Does not exist)
[ProgramFetcher] Execute data source
Calling: /omd/sites/selu/share/check_mk/agents/special/agent_vsphere '-u' 'checkmk_reader@vsphere.local' '-s=D*************#' '-i' 'virtualmachine,datastore' '-P' '--spaces' 'underscore' '--vm_piggyname' 'alias' '--no-cert-check' 'xx.xx.xx.xx'
[cpu_tracking] Stop [7**********0 - Snapshot(process=posix.times_result(user=0.0, system=0.0, children_user=0.17, children_system=0.02, elapsed=0.1900000013411045))]
Agent exited with code 1: HTTPSConnectionPool(host='xx.xx.xx.xx', port=443): Max retries exceeded with url: /sdk (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7ff380273940>: Failed to establish a new connection: [Errno 111] Connection refused'))

In your ruleset for the vsphere special agent, you have probably missed to pin it to only the vcenter host.

The docs mention this only briefly in the text, but do not show it in the screenshot.

[…] and set the condition to the appropriate host as defined in Checkmk

In your “VMWare ESX via vSphere” ruleset entry, scroll all the way down to “Conditions”, activate “Explicit hosts” and select your vCenter host so this rule will not apply to other, non-vCenter hosts.
(Of course you can also use different conditions like tags, labels, folder, … whatever suits your environment)

Looks a lot better now !
Thanks !

1 Like