<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Ambari custom alert failing in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183374#M80648</link>
    <description>&lt;P&gt;I have created a custom kafka ambari alert.  I have verified I am able to connect via jconsole to view the kafka jmx metrics&lt;/P&gt;&lt;P&gt;The error on ambari alert is: &lt;/P&gt;&lt;PRE&gt;[Alert][kafka_broker_mean_rate5] Unable to extract JSON from JMX response&lt;/PRE&gt;&lt;P&gt;My alerts.json:&lt;/P&gt;&lt;PRE&gt;{
  "AlertDefinition" : {
      "cluster_name" : "kafka-wiz",
      "component_name" : "KAFKA_BROKER",
      "description" : "This kafka broker alert is triggered if input bytes mean rate exeeds 25.",
      "enabled" : true,
      "help_url" : null,
      "ignore_host" : false,
      "interval" : 1,
      "label" : "[CUSTOM6] Kafka Broker Alert",
      "name" : "kafka_broker_mean_rate6",
      "repeat_tolerance" : 1,
      "repeat_tolerance_enabled" : false,
      "scope" : "ANY",
      "service_name" : "KAFKA",
      "source" : {
        "jmx" : {
          "property_list" : ["kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec/MeanRate"],
          "value" : "{0}"
        },
        "reporting" : {
          "ok" : {
            "text" : "Kafka input mean rate: {0}"
          },
          "warning" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 25
          },
          "critical" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 50
          },
          "units" : "bytes"
        },
        "type" : "METRIC",
        "uri" : { "http" : "xxxx.field.xxx.com",
	"default_port" : 16667 }
      }
    }
}
&lt;/PRE&gt;&lt;P&gt;Any feedback appreciated. &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/8196i59473B11BDC2ADE4/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="2018-07-12-15-41-27.png" title="2018-07-12-15-41-27.png" /&gt;</description>
    <pubDate>Fri, 13 Jul 2018 03:48:46 GMT</pubDate>
    <dc:creator>sunile_manjee</dc:creator>
    <dc:date>2018-07-13T03:48:46Z</dc:date>
    <item>
      <title>Ambari custom alert failing</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183374#M80648</link>
      <description>&lt;P&gt;I have created a custom kafka ambari alert.  I have verified I am able to connect via jconsole to view the kafka jmx metrics&lt;/P&gt;&lt;P&gt;The error on ambari alert is: &lt;/P&gt;&lt;PRE&gt;[Alert][kafka_broker_mean_rate5] Unable to extract JSON from JMX response&lt;/PRE&gt;&lt;P&gt;My alerts.json:&lt;/P&gt;&lt;PRE&gt;{
  "AlertDefinition" : {
      "cluster_name" : "kafka-wiz",
      "component_name" : "KAFKA_BROKER",
      "description" : "This kafka broker alert is triggered if input bytes mean rate exeeds 25.",
      "enabled" : true,
      "help_url" : null,
      "ignore_host" : false,
      "interval" : 1,
      "label" : "[CUSTOM6] Kafka Broker Alert",
      "name" : "kafka_broker_mean_rate6",
      "repeat_tolerance" : 1,
      "repeat_tolerance_enabled" : false,
      "scope" : "ANY",
      "service_name" : "KAFKA",
      "source" : {
        "jmx" : {
          "property_list" : ["kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec/MeanRate"],
          "value" : "{0}"
        },
        "reporting" : {
          "ok" : {
            "text" : "Kafka input mean rate: {0}"
          },
          "warning" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 25
          },
          "critical" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 50
          },
          "units" : "bytes"
        },
        "type" : "METRIC",
        "uri" : { "http" : "xxxx.field.xxx.com",
	"default_port" : 16667 }
      }
    }
}
&lt;/PRE&gt;&lt;P&gt;Any feedback appreciated. &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/8196i59473B11BDC2ADE4/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="2018-07-12-15-41-27.png" title="2018-07-12-15-41-27.png" /&gt;</description>
      <pubDate>Fri, 13 Jul 2018 03:48:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183374#M80648</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2018-07-13T03:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari custom alert failing</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183375#M80649</link>
      <description>&lt;P style="margin-left: 40px;"&gt;&lt;A rel="user" href="https://community.cloudera.com/users/81223/sunilemanjee-1.html" nodeid="81223"&gt;@sunile.manjee&lt;/A&gt; was looking at the code in Ambari below specific to metric alerts and it seems as if that default_port value is not being used as in other alert types&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&lt;A href="https://github.com/apache/ambari/blob/branch-2.6/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py#L87-L110"&gt;https://github.com/apache/ambari/blob/branch-2.6/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py#L87-L110&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;Function used to extract uri appears to only use the default port if uri isn't defined: &lt;A href="https://github.com/apache/ambari/blob/branch-2.6/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py#L331-L389"&gt;https://github.com/apache/ambari/blob/branch-2.6/ambari-agent/src/main/python/ambari_agent/alerts/base_alert.py#L331-L389&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;Also in other examples I've seen the uri is parameterized with a value from Ambari configuration.  And when looking at the ambari config the port value is actually included with the uri and not separated out .  See &lt;A href="https://community.hortonworks.com/articles/143762/how-to-create-a-custom-ambari-alert-and-use-it-for.html"&gt;&lt;/A&gt;example in &lt;BR /&gt;Create Custom Alert JSON file" section here: &lt;A href="https://community.hortonworks.com/articles/143762/how-to-create-a-custom-ambari-alert-and-use-it-for.html"&gt;https://community.hortonworks.com/articles/143762/how-to-create-a-custom-ambari-alert-and-use-it-for.html&lt;/A&gt; .&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;It may be worthwhile to try including the the port value with the uri&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 09:31:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183375#M80649</guid>
      <dc:creator>ydavis</dc:creator>
      <dc:date>2018-07-13T09:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari custom alert failing</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183376#M80650</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/3136/ydavis.html" nodeid="3136"&gt;@Yolanda M. Davis&lt;/A&gt; Thanks for your response.  I have tried 7 different combos the the ambari alert and all seem to fail.  Here is the ambari alert without default port and the port included in the uri&lt;/P&gt;&lt;PRE&gt;{
  "AlertDefinition" : {
      "cluster_name" : "kafka-wiz",
      "component_name" : "KAFKA_BROKER",
      "description" : "This kafka broker alert is triggered if input bytes mean rate exeeds 25.",
      "enabled" : true,
      "help_url" : null,
      "ignore_host" : false,
      "interval" : 1,
      "label" : "[CUSTOM7] Kafka Broker Alert",
      "name" : "kafka_broker_mean_rate7",
      "repeat_tolerance" : 1,
      "repeat_tolerance_enabled" : false,
      "scope" : "ANY",
      "service_name" : "KAFKA",
      "source" : {
        "jmx" : {
          "property_list" : ["kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec/MeanRate"],
          "value" : "{0}"
        },
        "reporting" : {
          "ok" : {
            "text" : "Kafka input mean rate: {0}"
          },
          "warning" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 25
          },
          "critical" : {
            "text" : "Kafka input mean rate: {0}",
            "value" : 50
          },
          "units" : "bytes"
        },
        "type" : "METRIC",
        "uri" : { "http" : "kafka-xxx-messaging-1.xxx.xxxxx.com:16667"}
      }
    }
}
&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I verified I am able to connect via jconsole on that port.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 22:46:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183376#M80650</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2018-07-18T22:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ambari custom alert failing</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183377#M80651</link>
      <description>&lt;P&gt;I found the issue.  Ambari alerts support JMX but only via HTTP.  Having JMX alone does not allow for ambari alert to be created.  Therefore, what I am trying to do is create ambari alert on kafka where jmx is available through jconsole connnection. However, those metrics are not expose via http and return json result.  Basically, it can't be done unless JMX is exposed via HTTP&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jul 2018 23:37:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ambari-custom-alert-failing/m-p/183377#M80651</guid>
      <dc:creator>sunile_manjee</dc:creator>
      <dc:date>2018-07-23T23:37:06Z</dc:date>
    </item>
  </channel>
</rss>

