4.2 Using the Alarms Script to Monitor ESX and ESXi Hardware

You can use the VirtualCenter_Alarms Knowledge Script to monitor state changes in your ESX or ESXi hardware, such as when a fan in a group of fans is close to overheating. Before you can monitor your hardware with the Alarms script, you need to create the hardware alarms in vCenter.

System requirements for monitoring ESX and ESXi hardware:

  • At minimum, VMware vSphere 4.0

  • At minimum, ESX 3.5, Update 4, or ESXi 4.0

To create a custom alarm in vCenter:

  1. In vCenter, locate the ESX or ESXi server you want to monitor in the left pane.

  2. On the Hardware Status tab, identify the hardware element you want to monitor, such as a fan group.

  3. On the Alarms tab, verify that the Definitions view is selected.

  4. Right-click anywhere on the Alarms tab and select New Alarm.

  5. In the Alarm Settings dialog box, type an alarm name, such as All Fans - Status Yellow.

    NOTE:Make a note of this name, as you will need to type this name into the VirtualCenter_Alarms Knowledge Script in AppManager when you run the VirtualCenter_Alarms script.

  6. Type a short description of the alarm, such as Alarm triggered when any Host's fan has a status of Yellow.

  7. From the Monitor list, select Hosts.

  8. Select Monitor for specific events occurring on this object.

  9. Verify that Enable this alarm is checked.

  10. On the Triggers tab, click Add.

  11. From the Event list, select the relevant event type, such as Hardware Health Changed.

  12. From the Status list, select the relevant alarm status, such as Alert or Warning.

  13. In the Conditions field, click Advanced.

  14. In the Trigger Conditions dialog box, specify the different Argument > Operator > Value combinations that must be present to set off the alarm. For example, newgroup > equal to > Fan and newState > equal to > Yellow.

    NOTE:The newGroup argument represents the sensor being monitored, such as Fan or Voltage. The newState argument represents the current state of the sensor in the newGroup argument.

  15. Click OK to close the Trigger Conditions dialog box.

  16. Click OK to close the Alarms Settings dialog box. The custom alarm is now set up in vCenter, and you can start monitoring that alarm with AppManager.

To set up the Alarms script to monitor the new custom alarm in vCenter:

  1. In AppManager, run the VirtualCenter_Alarms Knowledge Script on the vCenter object you want to monitor for ESX or ESXi hardware alarms.

  2. Click the Values tab.

  3. If you set up a vCenter alert alarm in the previous procedure, type the alert alarm name, such as All Fans - Status Yellow , into the Alarm name parameter under the Raise event if vCenter alert alarm is triggered? parameter.

  4. If you set up a vCenter warning alarm in the previous procedure, type the warning alarm name, such as All Fans - Status Red, into the Alarm name parameter under the Raise event if vCenter warning alarm is triggered? parameter.

  5. Select Yes for the relevant Raise event parameter.

  6. Set the severity level in the relevant Event severity parameter.

  7. Click OK to run the script.

NOTE:Closing the AppManager Alarms event will not clear the alarm event in vCenter, and closing the vCenter alarm will not clear the AppManager Alarms event.