openstack-ansible/scripts/maas_remove.sh
Jesse Pretorius 32095707ec replace blank line whitespaces from scripts
Change-Id: I16961f1efa5fcaf067ba688e1244c00d22b54a6e
Closes-Bug: 1398930
2014-12-03 18:46:09 +00:00

12 lines
773 B
Bash
Executable File

# Put your cloud account username in here
USERNAME=''
# Put your cloud account API Key in here
APIKEY=''
# Specify the string for which to match (on entity names) and remove all alarm/schecks for those enttities
STRING_MATCH='THIS WILL NEVER MATCH ONLY CHANGE THIS TO A SENSIBLE VALUE'
# NB - use with caution, will remove all alarms/checks for enttities that are matched.
ENTITIES=$(raxmon-entities-list --username $USERNAME --api-key $APIKEY | grep $STRING_MATCH | awk '{print $2}' | cut -d = -f2)
for e in $ENTITIES; do CHECKS=$(raxmon-checks-list --username $USERNAME --api-key $APIKEY --entity-id $e | grep Check | awk '{print $2}' | cut -d = -f 2); for c in $CHECKS; do raxmon-checks-delete --username $USERNAME --api-key $APIKEY --entity-id $e --id $c; done; done