Who acknowledged that alarm ?

Sometimes a solution to a problem is just staring you in the face.
While writing the PowerCLI book, I spent quite a bit of time on how to find which user acknowledged an alarm.
Today Eric “Scoop” Sloof launched the same question on Twitter. While I thought it was not possible, based on my past investigations, I decided to have a second look.

And of course now I found in a matter of minutes what had cost me fruitless hours before.

While pondering the problem I realised that the acknowledgement couldn’t be stored in the Alarm itself. So I decided to have another look at the object on which the Alarm was defined.

The alarm I looked at was the infamous Non-VI workload detected on the datastore.

The acknowledgement info is stored under the DeclaredAlarmState property of the ManagedEntity object.

The following little script will look at all datastores and list those where the alarm has been acknowledged.

This produces output like this (provided you acknowledged the alarm on some datastores of course).

The example script only showed how to retrieve acknowledgements for datastores, but since the DeclaredAlarmState property
belongs to the ManagedEntity object, you can use this logic for any vSphere object.
Thanks to Eric and William for making me have a 2nd look at this.


    Ernst Cozijnsen

    Hi Luc,

    Thanks for the solution to our problem. I spend hours and hours digging through all the objects and as you have show I looked in the wrong direction.
    How simple things can be that time consuming 😉


    Steve Jin

    Hi Luc,

    Great post. Did you mean declaredAlarmState property in places of alarmActionEnabled? The later is just a boolean property.



      @Steve, you’re right. The text was wrong, while the script was correct.
      I corrected the error, thanks for spotting this.

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.