Community Articles
Find and share helpful community-sourced technical articles
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)

First you need to get the ID of the alert definition in your system:

curl -H "X-Requested-By: ambari" -u admin:<password> -X GET http://<ambari_host>:<ambari_port>/api/v1/clusters/<cluster_name>/alert_definitions?AlertDefinition/...

Get the alert definition with the id from prevoius step:

curl -H "X-Requested-By: ambari" -u admin:<password> -X GET http://<ambari_host>:<ambari_port>/api/v1/clusters/<cluster_name>/alert_definitions/61

Set the new thresholds by changing the JSON alert definition:

curl -H "X-Requested-By: ambari" -u admin:<password> -i -X PUT -d '
      "description":"This host-level alert is triggered if the amount of disk space used on a host goes above specific thresholds. The default values are 85% for WARNING and 90% for CRITICAL.",
      "label":"Ambari Agent Disk Usage",
               "display_name":"Minimum Free Space",
               "description":"The overall amount of free disk space left before an alert is triggered.",
               "description":"The percent of disk space consumed before a warning is triggered.",
               "description":"The percent of disk space consumed before a critical alert is triggered.",
}' http://<ambari_host>:<ambari_port>/api/v1/clusters/<cluster_name>/alert_definitions/61

Ambari API Reference:

New Contributor

I found it easier to download the json to a file, edit it on disk, then use the `-d @filename.json` in the final step to avoid lengthy command lines. The only caveat: the "href" line needs to be deleted from the json obtained in step two.

Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎04-15-2016 01:26 PM
Updated by:
Top Kudoed Authors