<?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>topic Re: PA CPU usage via the API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/524643#M3275</link>
    <description>&lt;P&gt;3 year bump here, trying to achieve the same and noticing the same that it's a backend PHP code call.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[2022/12/20 14:32:22] &amp;#27;[41m ExtDirect_Router &amp;#27;[0m (INFO) 8836928913151289 - -
Call to [PanDirect.run] /DashboardDirect.getSystemResources from router.php
[2022/12/20 14:32:22] &amp;#27;[42m PanDirect &amp;#27;[0m (INFO) 8836928913151289 - -
========= RemoteCall: DashboardDirect.getSystemResources =========
[20-Dec-2022 14:32:22 America/New_York] [2022/12/20 14:32:22] &amp;#27;[41m panui_core\mgmt\MSConnection &amp;#27;[0m (DEBUG) 8836928913151289 - -
socket 40 sending request &amp;lt;request cmd="status" cookie="8836928913151289"/&amp;gt;

[20-Dec-2022 14:32:22 America/New_York] [2022/12/20 14:32:22] &amp;#27;[41m panui_core\mgmt\MSConnection &amp;#27;[0m (DEBUG) 8836928913151289 - -
socket 40 response took 0.072s &amp;lt;response status="success"&amp;gt;
&amp;lt;status&amp;gt;
&amp;lt;stats&amp;gt;
&amp;lt;mp-cpu-utilization&amp;gt;3&amp;lt;/mp-cpu-utilization&amp;gt;
&amp;lt;dp-cpu-utilization&amp;gt;1&amp;lt;/dp-cpu-utilization&amp;gt;
&amp;lt;/stats&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;You can also get the same info via &amp;gt;show system state | match sys.monitor.s0.mp.exports, unfortunately it returns a non-XML formatted response with a huge amount of text. (credit:&amp;nbsp;&lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PLKKCA4" target="_blank"&gt;https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PLKKCA4&lt;/A&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2022 19:39:52 GMT</pubDate>
    <dc:creator>Chris_Ruhrup</dc:creator>
    <dc:date>2022-12-20T19:39:52Z</dc:date>
    <item>
      <title>PA CPU usage via the API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/259277#M1911</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In PA Firewall Dashboard we have the system Reousrces widget, were we can see the Management CPU and Data Plane CPU usage, I was trying to do the same using the API, but I'm not sure how PA are calculating the values,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The GUI is sending a POST request to the backed PHP code (DashboardDirect.getSystemResources) to get the values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But we don't have such API available to use,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So for DP CPU usage we can use&amp;nbsp; *show running resource-monitor*&amp;nbsp; API and we can calculate the CPU load during the last 60 seconds and we can get a value that is similar to the one in the GUI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for the MP it's a bit complicated! *show system resources* API will return a text output of the command itself, and we can get the details from the below part&amp;nbsp;&lt;BR /&gt;*Cpu(s): 51.9%us, 5.4%sy, 1.0%ni, 41.6%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So my concern is how to calcluate the load average from the output, and I'm trying to query the api multiple times but I'm getting the same output each time for a long time!! the below row will never change! any&amp;nbsp; caching is being done via the API ?!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;*Cpu(s): 51.9%us, 5.4%sy, 1.0%ni, 41.6%id, 0.1%wa, 0.0%hi, 0.0%si, 0.0%st*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mohammad&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 14:18:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/259277#M1911</guid>
      <dc:creator>Mohammad.Qawasmeh</dc:creator>
      <dc:date>2019-04-30T14:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: PA CPU usage via the API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/259734#M1918</link>
      <description>You could also just query the mp-monitor.log from the API which is going to return in the same format you saw in show running resource-monitor</description>
      <pubDate>Fri, 03 May 2019 13:56:37 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/259734#M1918</guid>
      <dc:creator>nigelswift</dc:creator>
      <dc:date>2019-05-03T13:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: PA CPU usage via the API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/524643#M3275</link>
      <description>&lt;P&gt;3 year bump here, trying to achieve the same and noticing the same that it's a backend PHP code call.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;[2022/12/20 14:32:22] &amp;#27;[41m ExtDirect_Router &amp;#27;[0m (INFO) 8836928913151289 - -
Call to [PanDirect.run] /DashboardDirect.getSystemResources from router.php
[2022/12/20 14:32:22] &amp;#27;[42m PanDirect &amp;#27;[0m (INFO) 8836928913151289 - -
========= RemoteCall: DashboardDirect.getSystemResources =========
[20-Dec-2022 14:32:22 America/New_York] [2022/12/20 14:32:22] &amp;#27;[41m panui_core\mgmt\MSConnection &amp;#27;[0m (DEBUG) 8836928913151289 - -
socket 40 sending request &amp;lt;request cmd="status" cookie="8836928913151289"/&amp;gt;

[20-Dec-2022 14:32:22 America/New_York] [2022/12/20 14:32:22] &amp;#27;[41m panui_core\mgmt\MSConnection &amp;#27;[0m (DEBUG) 8836928913151289 - -
socket 40 response took 0.072s &amp;lt;response status="success"&amp;gt;
&amp;lt;status&amp;gt;
&amp;lt;stats&amp;gt;
&amp;lt;mp-cpu-utilization&amp;gt;3&amp;lt;/mp-cpu-utilization&amp;gt;
&amp;lt;dp-cpu-utilization&amp;gt;1&amp;lt;/dp-cpu-utilization&amp;gt;
&amp;lt;/stats&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;You can also get the same info via &amp;gt;show system state | match sys.monitor.s0.mp.exports, unfortunately it returns a non-XML formatted response with a huge amount of text. (credit:&amp;nbsp;&lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PLKKCA4" target="_blank"&gt;https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PLKKCA4&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 19:39:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/pa-cpu-usage-via-the-api/m-p/524643#M3275</guid>
      <dc:creator>Chris_Ruhrup</dc:creator>
      <dc:date>2022-12-20T19:39:52Z</dc:date>
    </item>
  </channel>
</rss>

