<?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 Re: how to identify alert from kafka service in ambari by REST API in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284671#M211368</link>
    <description>&lt;P&gt;Dear Jay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so from your example , I understand that we need to capture the - "state" from the output for each kafka broker , while expected output should be OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;am I right until now?&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 20:24:08 GMT</pubDate>
    <dc:creator>mike_bronson7</dc:creator>
    <dc:date>2019-12-03T20:24:08Z</dc:date>
    <item>
      <title>how to identify alert from kafka service in ambari by REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284633#M211339</link>
      <description>&lt;P&gt;hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we want to identify kafka alert from ambari by rest api&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example when we get alert&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/25585i9DDB97F9251FE3D0/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;what is the AMBARI REST API in order to verify alert on kafka broker01 or kafka broker02 , etc&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 16:19:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284633#M211339</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2019-12-03T16:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to identify alert from kafka service in ambari by REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284668#M211365</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://$AMBARI_HOST:8080/api/v1/clusters/$CLUSTER_NAME/alerts?fields=*&amp;amp;Alert/service_name=KAFKA"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=*&amp;amp;Alert/service_name=KAFKA" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=*&amp;amp;Alert/service_name=KAFKA&amp;lt;/a&amp;gt;"
{
  "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=*&amp;amp;Alert/service_name=KAFKA" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=*&amp;amp;Alert/service_name=KAFKA&amp;lt;/a&amp;gt;",
  "items" : [
    {
      "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/704" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/704&amp;lt;/a&amp;gt;",
      "Alert" : {
        "cluster_name" : "NewCluster",
        "component_name" : "KAFKA_BROKER",
        "definition_id" : 401,
        "definition_name" : "kafka_broker_process",
        "firmness" : "HARD",
        "host_name" : "newhwx3.example.com",
        "id" : 704,
        "instance" : null,
        "label" : "Kafka Broker Process",
        "latest_timestamp" : 1575403190535,
        "maintenance_state" : "OFF",
        "occurrences" : 14,
        "original_timestamp" : 1575402410385,
        "repeat_tolerance" : 1,
        "repeat_tolerance_remaining" : 0,
        "scope" : "HOST",
        "service_name" : "KAFKA",
        "state" : "OK",
        "text" : "TCP OK - 0.000s response on port 6667"
      }
    },
    {
      "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/1201" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/1201&amp;lt;/a&amp;gt;",
      "Alert" : {
        "cluster_name" : "NewCluster",
        "component_name" : "KAFKA_BROKER",
        "definition_id" : 401,
        "definition_name" : "kafka_broker_process",
        "firmness" : "HARD",
        "host_name" : "newhwx5.example.com",
        "id" : 1201,
        "instance" : null,
        "label" : "Kafka Broker Process",
        "latest_timestamp" : 1575403167289,
        "maintenance_state" : "OFF",
        "occurrences" : 12,
        "original_timestamp" : 1575402507311,
        "repeat_tolerance" : 1,
        "repeat_tolerance_remaining" : 0,
        "scope" : "HOST",
        "service_name" : "KAFKA",
        "state" : "CRITICAL",
        "text" : "Connection failed: [Errno 111] Connection refused to newhwx5.example.com:6667"
      }
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:03:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284668#M211365</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-12-03T20:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to identify alert from kafka service in ambari by REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284671#M211368</link>
      <description>&lt;P&gt;Dear Jay&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so from your example , I understand that we need to capture the - "state" from the output for each kafka broker , while expected output should be OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;am I right until now?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:24:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284671#M211368</guid>
      <dc:creator>mike_bronson7</dc:creator>
      <dc:date>2019-12-03T20:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to identify alert from kafka service in ambari by REST API</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284675#M211372</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/59349"&gt;@mike_bronson7&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you are right if the alert state is "OK" means the service is running well usually. If it is WARNING/CRITICAL then we need to look at the alert &lt;STRONG&gt;text&lt;/STRONG&gt; and alert &lt;STRONG&gt;host&lt;/STRONG&gt; to find out why and in which host the alert is in that state.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Basically the Kafka "&lt;STRONG&gt;host&lt;/STRONG&gt;" where the alert was triggered, The "&lt;STRONG&gt;state&lt;/STRONG&gt;" of the alert like CRITICAL,OK,WARNING and then Alert "&lt;STRONG&gt;text&lt;/STRONG&gt;" are usually the important parts of an alert which gives us a good idea on what is happening.&lt;/P&gt;&lt;P&gt;So you can capture those selected output using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "http://$AMBARI_HOST:8080/api/v1/clusters/NewCluster/alerts?fields=Alert/host_name,Alert/host_name,Alert/state,Alert/text&amp;amp;Alert/service_name=KAFKA"&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# curl -u admin:admin -H "X-Requested-By: ambari" -X GET "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/$CLUSTER_NAME/alerts?fields=Alert/host_name,Alert/host_name,Alert/state,Alert/text&amp;amp;Alert/service_name=KAFKA" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/$CLUSTER_NAME/alerts?fields=Alert/host_name,Alert/host_name,Alert/state,Alert/text&amp;amp;Alert/service_name=KAFKA&amp;lt;/a&amp;gt;" 
{
  "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=Alert/host_name,Alert/host_name,Alert/state,Alert/text&amp;amp;Alert/service_name=KAFKA" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts?fields=Alert/host_name,Alert/host_name,Alert/state,Alert/text&amp;amp;Alert/service_name=KAFKA&amp;lt;/a&amp;gt;",
  "items" : [
    {
      "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/704" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/704&amp;lt;/a&amp;gt;",
      "Alert" : {
        "cluster_name" : "NewCluster",
        "definition_id" : 401,
        "definition_name" : "kafka_broker_process",
        "host_name" : "newhwx3.example.com",
        "id" : 704,
        "service_name" : "KAFKA",
        "state" : "OK",
        "text" : "TCP OK - 0.000s response on port 6667"
      }
    },
    {
      "href" : "&amp;lt;a href="http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/1201" target="_blank"&amp;gt;http://newhwx1.example.com:8080/api/v1/clusters/NewCluster/alerts/1201&amp;lt;/a&amp;gt;",
      "Alert" : {
        "cluster_name" : "NewCluster",
        "definition_id" : 401,
        "definition_name" : "kafka_broker_process",
        "host_name" : "newhwx5.example.com",
        "id" : 1201,
        "service_name" : "KAFKA",
        "state" : "CRITICAL",
        "text" : "Connection failed: [Errno 111] Connection refused to newhwx5.example.com:6667"
      }
    }
  ]
}&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:41:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-to-identify-alert-from-kafka-service-in-ambari-by-REST/m-p/284675#M211372</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2019-12-03T20:41:12Z</dc:date>
    </item>
  </channel>
</rss>

