I have over 1000 inactive alerts and looking for an expedited way to clear these out. Currently only able to do it 8 or so at a time by going to 'Alerts' tab selecting each of them, going to actions and deleting cancelled alerts.
Looking for a better way, thanks!
Use PowerShell to Get-OMAlert and then Set-OMAlert.
That sounds interesting, how do I access that REST API or utilize that?
The REST documentation is on your vROps node at https://<vrops hostname>/suite-api
Here is a good intro video.
vRealize Operations Manager API Introduction w/ John Dias (@johnddias) - YouTube
Hi,
Can you expand on the commands?
i am able to run "Get-OMAlert -Status Active | Set-OMAlert -Cancel" which changes the alerts from "active" to "cancel" state.
How do I then delete canceled alerts?
from a quick google search i found Set-OMAlert only has few syntax and delete in not one of them
Set-OMAlert -TakeOwnership
Set-OMAlert -ReleaseOwnership
Set-OMAlert -SuspendMinutes
Set-OMAlert -Cancel
Thanks,
Vijay
You'll probably have to use the REST API to delete the cancelled alerts. It's not built in to PowerCLI. It's possible to access the API using "ExtensionData", explained here:
Using the entire API for vRealize Operations via PowerCLI - VMware PowerCLI Blog - VMware Blogs
However I searched and wasn't able to find the new delete API anywhere in PowerCLI. The vROps module hasn't been updated in a while so I suspect that might be why... or it's possible I missed it somewhere.
Either way I think it's worth noting that vROps will delete cancelled alerts automatically based on the global settings. The default is after 30 days. If you can work off of active alerts and think of the cancelled ones as just historical records they should clean themselves up after a while.