Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Alert of METRIC type on Ambari – Alerting based on AMS Metrics

Alert of METRIC type on Ambari – Alerting based on AMS Metrics

New Contributor

Hi team,

I have a bunch of custom metrics sitting in AMS (which is also graphed by Grafana). Now I want to implement an alert for those. I've looked around and so far I can only see JMX example from https://github.com/apache/ambari/blob/branch-2.1/ambari-server/docs/api/v1/alert-definitions.md#metr...

Could anyone provide me an example of the JSON that I need to POST to Ambari's Alert? It should look really similar to this

{  
   "AlertDefinition":{  
      "component_name":"NiFi",
      "description":"xxx description",
      "enabled":true,
      "interval":1,
      "label":"xxx label",
      "name":"xxx name",
      "repeat_tolerance":1,
      "repeat_tolerance_enabled":true,
      "scope":"SERVICE",
      "service_name":"NIFI",
      "source":{  
         "ams":{  
            "metric_list":[  
               "metric0"
            ],
            "value":"{0}",
            "interval":60.0,
            "app_id":"NiFi",
            "minimum_value":1.0
         },
         "reporting":{  
            "ok":{  
               "text":"{0}%"
            },
            "warning":{  
               "text":"{0}%",
               "value":10.0
            },
            "critical":{  
               "text":"{0}%",
               "value":20.0
            },
            "units":"%"
         },
         "type":"METRIC",
         "uri":{  
            "http":"{{ams-site/timeline.metrics.service.webapp.address}}",
            "https":"{{ams-site/timeline.metrics.service.webapp.address}}",
            "https_property":"{{ams-site/timeline.metrics.service.http.policy}}",
            "https_property_value":"HTTPS_ONLY",
            "default_port":0.0,
            "connection_timeout":5.0
         }
      }
   }
}


1 REPLY 1

Re: Alert of METRIC type on Ambari – Alerting based on AMS Metrics

New Contributor

Hi. Did you ever figure this out? I am trying to do something similar and can't find good examples. Thanks.