Go to All Forums

Which API should I call to get data of memory utilization, cpu utilization ?

Hello,

Can you guide me to get data of memory utilization, CPU utilization chart by calling which API? I have attached an image of the charts.

Which API should I call to get data of memory utilization, CPU utilization mentioned above?

Like (2) Reply
Replies (7)

Hi,

To get the performance data of memory and CPU utilization, use the following API:

https://www.site24x7.com/api/reports/performance/<monitor_id>?period=<PERIOD>&report_attribute=<report_type>

where,

  • monitor_id - Unique ID of the monitor. You can find monitor_id using the monitor list API.
  • period - time period for which you wish to see data. 
  • report_type - the required performance metric for which you wish to see data. This param is optional and if not passed it will send the overall CPU, memory, and disk utilization for the selected server monitor. 

For example, to get the CPU utilization for the last 24 hours, you will have to input the API as follows:

$ curl "https://www.site24x7.com/api/reports/performance/1234567890?period=1&report_attribute=CPU" \
-X GET \
-H "Accept: application/json; version=2.0" \
-H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7ab2d1.8fcc9810810a216793f385b9dd6e125f"

Note: You can use 'Current Status' API to get the last polled data for these performance metrics.

Alternatively, you can also make your reports accessible to customers without a login using the Public Reports option:

  1. Log in to Site24x7 and go to Admin > Share > Public Reports (+).
  2. Provide a Display Name, Description, and select the Report Type that needs to be published.
  3. Then, select the Monitors/Monitor Groups/Tags and choose the time period for which you want to view performance data.
  4. Save your changes.
  5. You will get a Permalink that can be shared and an iframe that can be embedded in your website. 

Hope this helps. Let us know for further queries, if any, in the below thread.

 

Regards,

Mathangi

Like (0) Reply

Thankyou for your answer.

We need to display the same data as attached bellow in our application, can you guide me which api should I call to get the data for each sections. I need to show the 3 boxes in our application.

1. 

2.

3.

Like (0) Reply

Hi,

To get the performance data of memory, CPU and disk utilization, and monitor outages, use the following API:

https://www.site24x7.com/api/reports/summary/<monitor_id>?period=<report_period_constants>

where,

  • monitor_id - Unique ID of the monitor. You can find monitor_id using the monitor list API.
  • report_period_constants - time period for which you wish to see data.  

For example, to get the CPU, memory, disk utilization, outage details for the last 24 hours, you will have to input the API as follows:

$ curl "https://www.site24x7.com/api/reports/summary/2019293291?period=1" \

-X GET \

-H "Accept: application/json; version=2.0" \

-H "Authorization: Zoho-oauthtoken [authtoken]"

Hope this helps. We are working on providing the API to get the server details and system stats. Will update this thread once its live. Let us know for further questions, if any, in the below thread.

Thanks!

 

Regards,

Mathangi 

Like (0) Reply


Hello,

Can you tell when we can expect to get that api ?

Thank you

Like (0) Reply

Hi,

Our development team is diligently working on providing this API. Though we can't assure a timeline, we will definitely ensure this is done at the earliest. 

Will update this thread once the API is live. Thanks for understanding.

 

Regards,

Mathangi 

Like (0) Reply

Hi,

You can now get the server details and system stats from the same API that is used to get the memory, CPU, and disk utilization, and monitor outages:

https://www.site24x7.com/api/reports/summary/<monitor_id>?period=<report_period_constants>

where,

  • monitor_id - Unique ID of the monitor. You can find monitor_id using the monitor list API.
  • report_period_constants - time period for which you wish to see data.  

For example, to get the CPU, memory, disk utilization, outage details, server details for the last 24 hours, input the API as follows:

$ curl "https://www.site24x7.com/api/reports/summary/299953000001777005?period=1" \
-X GET \
-H "Accept: application/json; version=2.0" \
-H "Authorization: Zoho-oauthtoken 1000.41d9f2cfbd1b7a8f9e314b7aff7ab2d1.8fcc9810810a216793f385b9dd6e125f"

 

 

Hope this helps. Let us know for further queries, if any, in the below thread.

 

Regards,

Mathangi

Like (0) Reply

Was this post helpful?