Whatsup Vmware ESXi monitor

–These directions assume some whatsup knowledge.
–ESXi does not support SNMP gets, only TRAPS.

Setup

  • Install Python 2.6.x
  • Install pywbem
  • Download check_esx_wbem.py put it into c:\python26
  • In Whatsup create new windows credentials, for the domain use esx. For example use esx\root for the username and the input the password.
  • On the node make sure that its configured to use those credentials.
  • Create a new active script monitor and paste the code below.
  • Assign the active script monitor to your node and your all set.

I didn’t write the python script, if you have any problem please first test the python script from the command line. You have to use the windows installer for pywbem the latest version has a dependency that does not work in windows.

I have tested the script on IBM servers. Please let me know if you make any modifications to the script i would love to see them.

'Wbem ESX Monitor
'Stephen

Context.SetResult 0, "No Error"

sysAddress = Context.GetProperty("Address")
sysAdminUser = Context.GetProperty("CredWindows:DomainAndUserid")
sysAdminPass = Context.GetProperty("CredWindows:Password")
sysAdminUser = replace(sysAdminUser,"esx\","")
sysAddress = "https://" & sysAddress & ":5989"

esxcheck = "c:\python26\check_esx_wbem.py"

Set objShell = CreateObject("Wscript.Shell")
command = "python " & esxcheck & " " & sysAddress & " " &  sysAdminUser & " " & sysAdminPass
returncode = objShell.run(command ,0 , True)

Select Case returncode
 Case 0
  context.SetResult 0, "OK! Return Code:" & returncode
 Case 1
  context.SetREsult 1, "Warning!! Return Code:" & returncode
 Case 2
  context.SetResult 1,  "Critical!!! Return Code:" & returncode
 Case 3
  context.SetResult 1,  "Unknown!!! Return Code:" & returncode
End select

Here is my ClassesToCheck block, I added Fan and power supply.

# define classes to check 'OperationStatus' instance
ClassesToCheck = [
 'CIM_ComputerSystem',
 'CIM_NumericSensor',
 'CIM_Memory',
 'CIM_Processor',
 'CIM_RecordLog',
 'OMC_DiscreteSensor',
 'OMC_Fan',
 'OMC_PowerSupply',
 'VMware_StorageExtent',
 'VMware_Controller',
 'VMware_StorageVolume',
 'VMware_Battery',
 'VMware_SASSATAPort'
]