<?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 get disk info using Ambari API? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184543#M68044</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11713/grabowski14.html" nodeid="11713"&gt;@Mateusz Grabowski&lt;/A&gt; &lt;/P&gt;&lt;P&gt;The difference could be due to when the disk stats were measured. The stats in KB are coming from the ambari agent and the the one in GB is coming from Ambari Metrics Service. &lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2017 23:24:50 GMT</pubDate>
    <dc:creator>avijayan</dc:creator>
    <dc:date>2017-09-15T23:24:50Z</dc:date>
    <item>
      <title>How to get disk info using Ambari API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184540#M68041</link>
      <description>&lt;P&gt;Hi. I got a question which is associated with Ambari API. I want to run a script hdp-configuration-utils, but I need a couple of information - number of cores, memory, disks and HBase enabled (I did not install it so value is 'False').&lt;/P&gt;&lt;P&gt;My questions:&lt;/P&gt;&lt;P&gt;1. When I run command:&lt;/P&gt;&lt;PRE&gt;GET api/v1/clusters/c1/hosts&lt;/PRE&gt;&lt;P&gt;I get parameter names 'cpu_count' and 'ph_cpu_count'. Which one should I use?&lt;/P&gt;&lt;P&gt;2. How can I check what is number of disks?&lt;/P&gt;&lt;P&gt;3.  How can I get info about free and total disk size? I got two parameters:&lt;/P&gt;&lt;P&gt;- disk_info&lt;/P&gt;&lt;PRE&gt;"disk_info" : [
      {
        "available" : "42331676",
        "device" : "/dev/mapper/VolGroup-lv_root",
        "used" : "6521952",
        "percent" : "14%",
        "size" : "51475068",
        "type" : "ext4",
        "mountpoint" : "/"
      },
      {
        "available" : "423282",
        "device" : "/dev/sda1",
        "used" : "38770",
        "percent" : "9%",
        "size" : "487652",
        "type" : "ext4",
        "mountpoint" : "/boot"
      },
      {
        "available" : "45423700",
        "device" : "/dev/mapper/VolGroup-lv_home",
        "used" : "53456",
        "percent" : "1%",
        "size" : "47917960",
        "type" : "ext4",
        "mountpoint" : "/home"
      }
    ]&lt;/PRE&gt;&lt;P&gt;- metrics/disk&lt;/P&gt;&lt;PRE&gt;"disk" : {
      "disk_free" : 83.99,
      "disk_total" : 95.25,
      "read_bytes" : 1.9547998208E10,
      "read_count" : 1888751.0,
      "read_time" : 2468451.0,
      "write_bytes" : 1.5247885312E10,
      "write_count" : 2020357.0,
      "write_time" : 9.9537697E7
    }&lt;/PRE&gt;&lt;P&gt;Which one should I check when I want to compare it with offcial sizing recomendations?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2017 20:16:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184540#M68041</guid>
      <dc:creator>grabowski14</dc:creator>
      <dc:date>2017-09-14T20:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get disk info using Ambari API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184541#M68042</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/136319/how-to-get-disk-info-using-ambari-api.html#"&gt;@Mateusz Grabowski&lt;/A&gt;&lt;/P&gt;&lt;P&gt;1. From the Ambari agent implementation, it seems both the counts are using the same python API - &lt;A href="https://docs.python.org/2/library/multiprocessing.html#multiprocessing.cpu_count" target="_blank"&gt;https://docs.python.org/2/library/multiprocessing.html#multiprocessing.cpu_count&lt;/A&gt;. Hence they should have the same value. Are you seeing different values in your API response? If not, I can create a jira to track this bug.&lt;/P&gt;&lt;P&gt; 2. There does not seem to be a direct entry for that. You probably have to use the length of the 'disk_info' array in the JSON response to determine that.&lt;/P&gt;&lt;P&gt;3.  Both of them are giving the same information. The first one is per disk stats in KB, and the 2nd one is total disk stats in GB.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 06:20:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184541#M68042</guid>
      <dc:creator>avijayan</dc:creator>
      <dc:date>2017-09-15T06:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get disk info using Ambari API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184542#M68043</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/290/avijayan.html" nodeid="290"&gt;@Aravindan Vijayan&lt;/A&gt; &lt;/P&gt;&lt;P&gt;1. I see the same values, so it works good.&lt;/P&gt;&lt;P&gt;3. But when I added sizes of 3 disks from the first one I got 99880680 KB. The second one shows 95.25. What is the reason of the difference between them?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 15:06:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184542#M68043</guid>
      <dc:creator>grabowski14</dc:creator>
      <dc:date>2017-09-15T15:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get disk info using Ambari API?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184543#M68044</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11713/grabowski14.html" nodeid="11713"&gt;@Mateusz Grabowski&lt;/A&gt; &lt;/P&gt;&lt;P&gt;The difference could be due to when the disk stats were measured. The stats in KB are coming from the ambari agent and the the one in GB is coming from Ambari Metrics Service. &lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 23:24:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-disk-info-using-Ambari-API/m-p/184543#M68044</guid>
      <dc:creator>avijayan</dc:creator>
      <dc:date>2017-09-15T23:24:50Z</dc:date>
    </item>
  </channel>
</rss>

