http://jira.hyperic.com/browse/HHQ-3785
Tasks to allow for command line options to modify alert definitions without XML manipulation:
1) --assignEscalation: Assign the given escalation to the list of alerts
2) --assignScriptAction: Assign the given script to the list of alerts
3) --assignControlAction: Assign the given control action to the list of alerts. Note that this action would need to exist on all resources in the batch. i.e. we won't be able to do cross resource control actions.
Some examples:
1) Assign all resource alerts in group CPUS to the escalation "SEV1"
./bin/hqapi.sh alertdefinition list --group="CPUS" | ./bin/hqapi.sh sync --assignEscalation="SEV1"
2) Switch all alerts with escalation "SEV1" to escalation "SEV2"
./bin/hqapi.sh alertdefinition list --escalation="SEV1" | ./bin/hqapi.sh sync --assignEscalation="SEV2"
3) Assign a script action to all alerts in the system, committing the updates in batches of 10 (--batchSize is already supported, but wise to use here)
./bin/hqapi.sh alertdefinition list | ./bin/hqapi.sh --assignScriptAction="/opt/hyperic/alert.sh" --batchSize=10
4) Assign a control action of runGarbageCollector to all alerts on resources in group "JBoss"
./bin/hqapi.sh alertdefinition list --group="JBoss" | ./bin/hqapi.sh --assignControlAction=runGargabeCollector
Anonymous