Reporting on Alarm triggers

I see Get-AlarmAction and Get-AlarmActionTrigger which report on the action taken when an alarm goes off but how do I set or report on what sets an alarm off?

For instance how do I set a new alarm "Host CPU" that triggers if the host CPU value is at 85% for 2 minutes and once set how do I report back those triggers for the alarm?

Thanks

0 Kudos
4 Replies
DZ1
Hot Shot
Hot Shot


I used Project Onyx http://labs.vmware.com/flings/onyx to initially help me create an alarm with the specifications that I wanted, and then I changed certain areas for what I needed.  I connected with onyx, created the alarm that I wanted, the code was displayed on the screen, and then it was much easier to change it.

0 Kudos
CRad14
Hot Shot
Hot Shot

This may help

http://www.vnoob.com/2013/03/copy-alarms-from-one-vcenter-to-another/

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos

Thanks for the tip I think I'm onto something

(get-view (get-alarmdefinition | where {$_.entity -like "New Folder"})).info.expression.expression gives me an array of the triggers I'm looking for

   TypeName: VMware.Vim.MetricAlarmExpression

Name            MemberType Definition

----            ---------- ----------

Equals          Method     bool Equals(System.Object obj)

GetHashCode     Method     int GetHashCode()

GetType         Method     type GetType()

ToString        Method     string ToString()

DynamicProperty Property   VMware.Vim.DynamicProperty[] DynamicProperty {get;set;}

DynamicType     Property   System.String DynamicType {get;set;}

Metric          Property   VMware.Vim.PerfMetricId Metric {get;set;}

Operator        Property   VMware.Vim.MetricAlarmOperator Operator {get;set;}

Red             Property   System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Red {get;s

RedInterval     Property   System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] RedInterva

Type            Property   System.String Type {get;set;}

Yellow          Property   System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Yellow {ge

YellowInterval  Property   System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] YellowInte

0 Kudos
LucD
Leadership
Leadership

You might want to have a look at the Get-Alarm function in chapter 16 of the PowerCLI Reference book.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos