banshee/virtualization-collection/virtualization/vsphere/https/vcenter-7.0u2/
hosts
The connection state and the power state of each ESXi host of a VMware vCenter by its REST API.
par banshee1 installation1 version
v1Dernière
Publiée le 27 octobre 2026. First version.
Hosts of a VMware vCenter, by its REST API
Returns, for each ESXi host a vCenter manages, its connection state and its power state, read from the vCenter REST API with an account. Four watches are offered, each one set on the probe.
Versions
Written for the REST API that vCenter serves under /api from vSphere 7.0 Update 2 (7.0, 8.0 and 9.0). The older API under /rest, the only one of vSphere 6.5 to 7.0 Update 1, is not served: those versions are out of VMware's general support. Hence the folder vcenter-7.0u2.
How it works
The collector logs in once, then reads the list of the hosts:
POST https://<host:address>/api/session, the account in Basic. vCenter answers201and the id of a session, a JSON text. The id is kept in the cache of the probe, encrypted on the poller, for 50 minutes; a session vCenter no longer knows (expired, vCenter restarted) answers401, and the collector logs in again, once.GET https://<host:address>/api/vcenter/host, the id in the headervmware-api-session-id:
[{"host": "host-10", "name": "esx01.example", "connection_state": "CONNECTED", "power_state": "POWERED_ON"}] - A host is named as vCenter names it; two hosts of the same name (in two datacenters) each keep their own, the second carrying its id (
esx01.example #host-31). - The connection is vCenter's, in lower case,
_written-:connected,disconnected(an administrator disconnected it),not-responding(vCenter lost it). - The power is
powered-on,powered-offorstandby; vCenter gives it for a connected host only, and a host that is not connected returns its connection alone. - A code 401 or 403 at the login stops the collector
misconfigured, a code 403 on the list too; any other code but 200 stops itunreachable. No host at all stops itmisconfigured: the account sees only the hosts its role is set on.
The password comes from protocol:http:password, a secret variable: it only goes in the Basic header of the login. The id of the session is a secret too: it only goes in the header and in the cache.
Prerequisites
- The vCenter's address as the host's address, reachable from the poller in HTTPS (443), its certificate trusted by the TLS profile of the probe: the root certificate of the vCenter's own authority (VMCA, in
https://<vcenter>/certs/download.zip) underprotocol:tls:authorities, a pinned fingerprint inprotocol:http:fingerprint, or the first fingerprint trusted in the tab "Security". - A vSphere account (
monitoring@vsphere.local, or an account of the directory vCenter is joined to) given the role Read-only on the vCenter root, propagated to its children, inprotocol:http:userandprotocol:http:password.
Outputs
| Name | Label | Unit | Per instance |
|---|---|---|---|
connection | Connection | — | yes, per host |
power | Power | — | yes, per host |
Watches
| Name | Title | Kind | Defaults | Checked by default |
|---|---|---|---|---|
not-responding | Host not responding | state to avoid, on connection | critical on not-responding | yes |
disconnected | Host disconnected | state to avoid, on connection | warning on disconnected | yes |
powered-off | Host powered off or in standby | state to avoid, on power | warning on standby, critical on powered-off | yes |
missing | Host missing | expected instances, on connection | no host named: it raises nothing until names are set on the probe | no |
Limits
- The maintenance mode and the health alarms of a host are not read: the vCenter REST API does not serve them (neither under
/apiin 7.0 and 8.0 nor in 9.0). They are served by the vSphere Web Services API, and over JSON by its VI/JSON form from vSphere 8.0 Update 1, which this collector does not use. - Each probe of a vCenter keeps its own session: five probes, five sessions, each one closed by vCenter when it is idle.
- vCenter answers
500for more than 2,500 hosts: the collector then stopsunreachable. - The address is written into the URL as is: an IPv6 address must be given as a name.
- Not checked against a vCenter: the routes, fields and states are those of the published OpenAPI specifications of the vSphere Automation API, 7.0.3 and 8.0.2 (as the Ansible collection
vmware.vmware_restcarries them); whether every field is served as early as 7.0 U2 is not verified.