Skip to content

Instantly share code, notes, and snippets.

@M0NsTeRRR
Last active March 11, 2021 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M0NsTeRRR/5fe8e4e44d4a6b0c1fecf2b88bd0e67c to your computer and use it in GitHub Desktop.
Save M0NsTeRRR/5fe8e4e44d4a6b0c1fecf2b88bd0e67c to your computer and use it in GitHub Desktop.
# pyvmomi is required
# pip install pyvmomi
from pyVim.connect import SmartConnectNoSSL, Disconnect
import ssl
s = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
s.verify_mode = ssl.CERT_NONE
c = SmartConnectNoSSL(host='vcenter.homelab.lan.fr', user='root', pwd='password')
host = c.content.searchIndex.FindByDnsName(None,'server.homelab.lan',False)
health = host.runtime.healthSystemRuntime.systemHealthInfo.numericSensorInfo
print(health)
Disconnect(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment