<?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: Why is node in concerning status in CM using API in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38300#M21622</link>
    <description>&lt;P&gt;&amp;gt;...&amp;nbsp;&lt;SPAN&gt;query by id filter, ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For clarification, when you say "=id==" are you referring to&amp;nbsp;"hostId", or the unique "id" of the event.&lt;/P&gt;&lt;P&gt;Reason is that in your supplied URL "...&lt;SPAN&gt;query=id==&amp;lt;hostid&amp;gt;", &lt;/SPAN&gt;the "id" is a&amp;nbsp;unique ID for an&amp;nbsp;event [1]; however, &amp;lt;hostid&amp;gt; (&lt;SPAN&gt;HOST_IDS) key name&amp;nbsp;within the "&lt;SPAN&gt;attributes" listing&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;[1]. I think your&amp;nbsp;filter is expected to return 0, unless you have valid&amp;nbsp;the "id" for the event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it pull info if you change your query to filter the attributes.HOST_IDS?&lt;/P&gt;&lt;P&gt;ie:&amp;nbsp;&lt;SPAN&gt;http://cm:7180/api/v10/events&lt;/SPAN&gt;?query=attributes.HOST_IDS==%22&amp;lt;hostid&amp;gt;%22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[1]&amp;nbsp;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v11/ns0_apiEvent.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v11/ns0_apiEvent.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2016 20:47:19 GMT</pubDate>
    <dc:creator>michalis</dc:creator>
    <dc:date>2016-03-03T20:47:19Z</dc:date>
    <item>
      <title>Why is node in concerning status in CM using API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38230#M21619</link>
      <description>&lt;P&gt;We run multiple clusters from multiple teams on the same CM instance, so the email blast for any error for all clusters isn't very useful to us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can pull back from the api any node that is having a problem using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://bdatadevcm01.northamerica.cerner." target="_blank"&gt;http://bdatadevcm01.northamerica.cerner.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;curl --silent -u &amp;lt;user&amp;gt;:&amp;lt;pass&amp;gt; http://&amp;lt;CM&amp;gt;:7180/api/v10/clusters/&amp;lt;cluster&amp;gt;/services/&amp;lt;cluster&amp;gt;-hbase/roles | grep 'hostId\|healthSummary' | grep -B 1 CONCERNING | grep hostId | awk -F ':' '{print $2}' | awk -F '"' '{print $2}')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm aware it's not pretty, but that's not currently the point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will tell me any node in the cluster that's in a concerning status. I'd like to be able to pull back from the API the reason it's in a concerning status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I played around a bit with timeseries, and was able to pull back that the node has several events with the url:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;http://&amp;lt;cm&amp;gt;:7180/api/v10/timeseries?query=select+alerts+where+hostId%&amp;lt;hostid&amp;gt;&amp;amp;chartType=table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again though, this tell me the node has several alerts, but not what the alerts are.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have either the hostid or hostname, how can I pull back why the node is in a concerning status in CM using only the API?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:06:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38230#M21619</guid>
      <dc:creator>donigrubbs</dc:creator>
      <dc:date>2022-09-16T10:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why is node in concerning status in CM using API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38232#M21620</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;If I have either the hostid or hostname, how can I pull back why the node is in a concerning status in CM using only the API?&lt;/P&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;DIV&gt;There should be a record in your events [1a,b], using the CM API try filtering the hostid/host attributes [2]&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Hope this helps&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[1a] http://cloudera-server:7180/cmf/events&lt;/P&gt;&lt;P&gt;[1b]&amp;nbsp;&lt;SPAN&gt;http://cloudera-server:7180/api/v10/events&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;[2]&amp;nbsp;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v11/path__events.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v11/path__events.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 23:52:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38232#M21620</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2016-03-02T23:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why is node in concerning status in CM using API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38274#M21621</link>
      <description>&lt;P&gt;So I found where I can use the events in the api and add the query by id filter, so it looks like:&lt;/P&gt;&lt;P&gt;http://cm:7180/api/v10/events?query=id==&amp;lt;hostid&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used a random hostid from the events output to verify the query worked.&lt;/P&gt;&lt;P&gt;When I use the query to find using the hostid of the nodes in concerning status though, I get no results:&lt;/P&gt;&lt;PRE&gt;"totalResults" : 0,&lt;/PRE&gt;&lt;P&gt;Since we're doing this for testing, I know that the node is in concerning status due to&amp;nbsp;&lt;SPAN&gt;Log Directory Free Space. But I'm not seeing that on the events page.&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recreated a similar case where I created a large empty file on a random region server to get it into a concerning status due to lack of free space. Querying the events page with the host id, it pulls back no events for the host id, even though it was a very new change. I waited about 4 minutes after and checked again, but still wasn't able to pull back the reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then just went to the events page and looked for both hostid and hostname, but couldn't find any events specifically related to lack of free space.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 14:48:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38274#M21621</guid>
      <dc:creator>donigrubbs</dc:creator>
      <dc:date>2016-03-03T14:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why is node in concerning status in CM using API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38300#M21622</link>
      <description>&lt;P&gt;&amp;gt;...&amp;nbsp;&lt;SPAN&gt;query by id filter, ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For clarification, when you say "=id==" are you referring to&amp;nbsp;"hostId", or the unique "id" of the event.&lt;/P&gt;&lt;P&gt;Reason is that in your supplied URL "...&lt;SPAN&gt;query=id==&amp;lt;hostid&amp;gt;", &lt;/SPAN&gt;the "id" is a&amp;nbsp;unique ID for an&amp;nbsp;event [1]; however, &amp;lt;hostid&amp;gt; (&lt;SPAN&gt;HOST_IDS) key name&amp;nbsp;within the "&lt;SPAN&gt;attributes" listing&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;[1]. I think your&amp;nbsp;filter is expected to return 0, unless you have valid&amp;nbsp;the "id" for the event.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does it pull info if you change your query to filter the attributes.HOST_IDS?&lt;/P&gt;&lt;P&gt;ie:&amp;nbsp;&lt;SPAN&gt;http://cm:7180/api/v10/events&lt;/SPAN&gt;?query=attributes.HOST_IDS==%22&amp;lt;hostid&amp;gt;%22&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[1]&amp;nbsp;&lt;A href="https://cloudera.github.io/cm_api/apidocs/v11/ns0_apiEvent.html" target="_blank"&gt;https://cloudera.github.io/cm_api/apidocs/v11/ns0_apiEvent.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 20:47:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38300#M21622</guid>
      <dc:creator>michalis</dc:creator>
      <dc:date>2016-03-03T20:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is node in concerning status in CM using API</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38301#M21623</link>
      <description>&lt;P&gt;Yep, that did it. Didn't realize the id's were event id's and not host id's.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Used the attributes.HOST_IDS and was able to pull back the information for the host.&lt;/P&gt;&lt;P&gt;With this output, I can sort and build alerting off it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2016 20:52:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Why-is-node-in-concerning-status-in-CM-using-API/m-p/38301#M21623</guid>
      <dc:creator>donigrubbs</dc:creator>
      <dc:date>2016-03-03T20:52:54Z</dc:date>
    </item>
  </channel>
</rss>

