I know this is an old thread but is there a way to filter based on date?
Scenario:
- reset all alerts
- currently active one retriggers.
- tech is called for an already existing alert issue (host down or something like that).
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.
$alarmMgr = Get-View AlarmManager
$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)