VMware {code} Community
samsvmware
Enthusiast
Enthusiast

List VMs alarm list with description

Hi All,

           I have the script to fetch all alarm information like (alarm key, time, ack, alarm state etc). but I am not able to list its alarm description .

So can you let me know the API script or link to get the alarm description information.

1 Reply
amirsafayan
Enthusiast
Enthusiast

Have you looked to William Lams website virtuallyGhetto and specifically this page:

http://www.virtuallyghetto.com/2010/05/getting-started-with-vsphere-sdk-for.html

You can find a reference on that page to his vGhetto Script Repository here:
vGhetto Script Repository

He also has this script repository on github:
https://github.com/lamw/vghetto-scripts/tree/master/perl

Specifically look at this script alarmManagement.pl.  I've attached my modification to the script to provide timestamps.

My effort is to essentially poll our vCenter platform via the API for the current alarm states on a regular basis.  What I haven't been able to get is a mapping of an alarm to a vCenter object like "HOST" or "VM".  For some reason, Williams script shows the column  heading "Alarm Entity" but it is "Datacenters" for ALL my alarms. What I don't understand as well is the Alarm Key that is identified for each alarm.  This appears to be a unique identifier assigned to the alarms but I don't know if the numerical key is assigned based on the order in which the alarms are generated or how they are assigned.

Good luck and let me know if you have made any further improvements to Williams great script

Amir