Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

ESXI CIM hardware monitors


The below monitors are using VMware CIM SMASH/Server Management API to obtain hardware state information from ESXI host.


- create a scripts directory readable by SYSTEM account (or the account IPHost monitoring service is run under), default: C:\Scripts
- unpack *.ps1 (PowerShell) scripts into the scripts directory mentioned above
- IPHost Network Monitor v5.0 build 12338 or newer is required


Create Windows user credentials for ESXI host you will be using these monitors on (in IPHost GUI client: "Settings > User Credentials", click "Windows" tab, click "New"). Assign credential fields as below:
Domain: .
User: ESXI host API administration account (usually root)
Password: ESXI host API administration account password

Assign the above Windows credentials to the ESXI host. Make sure monitors created for this host inherit the above credentials (this is default).

Unpack ESXI-hardware-v1.xml file from the archive attached to this post and import it from IPHost GUI client. Note: you might need additional configuration prior to running monitor(s).

If your scripts directory differs from C:\Scripts, make sure to change the path to PS scripts in monitors definition, in "Arguments" field, for "-File" parameter.


Note that ESXI host doesn't instantiate corresponding CIM/derived classes for hardware that isn't installed. Thus, you might need to check actual hardware identifiers prior to running monitors.

For example, to list all available controllers, run PowerShell (as administrator), navigate to scripts directory and run command like
.\esxi-cim-getinstance.ps1 -HostEsxi ESXIip -UserName "root" -UserPassword "password" `
-ClassName CIM_Controller -FieldName ElementName
note that backtick character "`" is used to enter PowerShell command on multiple lines. Replace the ESXI host IP and credentials (written in bold above) with their actual values.

The above command will print some lines, like this:
Intel Corporation PX7450 Network Controller
ACME 2017 IDE Controller No.1
USB controller
Now, if you wish to monitor HealthState property of "ACME 2017 IDE Controller No.1", the "Arguments" field for your monitor should look like this:
-ExecutionPolicy ByPass -File  C:\Scripts\esxi-cim-filter-class-instance.ps1 -HostEsxi $HostIP
-UserName $WindowsUser -UserPassword $WindowsPassword -ClassName CIM_Controller
-CreationClassName VMware_PCIDevice -ElementName "*IDE Controller*" -FieldName HealthState
(the asterisk in "-ElementName" parameter are wildcards and mean "any amount of any characters". You can also include the exact element name, i.e.
-ExecutionPolicy ByPass -File  C:\Scripts\esxi-cim-filter-class-instance.ps1 -HostEsxi $HostIP
-UserName $WindowsUser -UserPassword $WindowsPassword -ClassName CIM_Controller
-CreationClassName VMware_PCIDevice -ElementName "ACME 2017 IDE Controller No.1" -FieldName HealthState
For more information, please refer to the mentioned API reference link above.


In case you need assistance with selecting proper class/instance name and/or finding proper CIM class for your monitor, please send us the results of command
.\esxi-cim-getinstance.ps1 -HostEsxi ESXIip -UserName "root" -UserPassword "password" `
-ClassName CIMclass
For example, if you need help choosing proper CIM_Controller instance, run command like
.\esxi-cim-getinstance.ps1 -HostEsxi ESXIip -UserName "root" -UserPassword "password" `
-ClassName CIM_Controller > cim-output.txt
and us the cim-output.txt file it creates, along with explanation of what are you looking for. If unsure which CIM class to use, send the above output for CIM_ManagedSystemElement or CIM_LogicalDevice class (after "-ClassName" parameter, instead of CIM_Controller in the command above) with details on what you are looking for.
Tagged: 3.8K Downloaded: 6595 times
Sign In or Register to comment.