Can someone please provide an example of how to make use of the new ESXi 6.7 API function ClearTriggeredAlarms as described here: https://vdc-repo.vmware.com/vmwb-repository/dcr-public/3325c370-b58c-4799-99ff-58ae3baac1bd/45789cc5...
Currently, I'm acknowledging alarms on all hosts within a cluster in a script, but I'd like to take that a step further and clear that specific alarm on all hosts as well. I can't seem to get the filter right to do this appropriately.
Thanks!
I know this is an old thread but is there a way to filter based on date?
Scenario:
Would be nice to filter based on date and only reset the older triggered alarms.
Could you filter based on acknowledged alerts and only clear those? Then possibly use another method to acknowledge the older alerts and then clear only the acknowledged alerts with this method?
This is the original solution posted by LucD which works great for clearing all triggered alarms.
Note that you can specify different values for all three enums, depending on which alarms you want to clear.
$filter = New-Object VMware.Vim.AlarmFilterSpec
$filter.Status += [VMware.Vim.ManagedEntityStatus]::red
$filter.TypeEntity = [VMware.Vim.AlarmFilterSpecAlarmTypeByEntity]::entityTypeVm
$filter.TypeTrigger = [vmware.vim.AlarmFilterSpecAlarmTypeByTrigger]::triggerTypeEvent
$alarmMgr.ClearTriggeredAlarms($filter)
Afaik, this is still the only method that clears all alarms.
No option to clear a specific alarm.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I would like to know if there is a way to reset to green for specific alarm to only a VM , I want to attach a script to alarm
Afaik unfortunately no.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference