Highlighted
PierceCJ
6 Indium

How to clear critical alerts in one command

I have over 200 critical alerts and don't see a way how to clear them all at once.  Does anybody knows how to do it?

Tags (1)
2 Replies
8 Krypton

Re: How to clear critical alerts in one command

I am looking for this as well. I want an easy way to "Acknowledge" everything quickly, instead of one at a time. very frustrating when testing and generating a ton of alerts.

Thanks!

0 Kudos
8 Krypton

Re: How to clear critical alerts in one command

Quick'n dirty:

#!/bin/bash

curl -s -L --location-trusted -k https://ECS-host:4443/login\?using-cookies=true -u ECS-user -c ~/.ecs_cookie

curl -s -k https://ECS-host:4443/vdc/alerts -b ~/.ecs_cookie  | xmllint --format - | \

  awk '/<id>/ { sub(".*<id>",""); sub("</id>",""); printf "curl -s -k -X PUT https://ECS-host:4443/vdc/alerts/%s/acknowledgment -b ~/.ecs_cookie\n", $0 }' > /tmp/ecs_alert.$$

rm -f /tmp/ecs_alert.$$

-urle