API for performance metrics?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lucas.shearer
Posts: 17
Joined: Fri Nov 19, 2021 12:00 pm

API for performance metrics?

Post by lucas.shearer »

I am trying to query performance metrics with an API call. Looking for metrics such as CPU Usage, Memory, Disk Utilization, and Network Utilization with their respective timestamps. Is there an API which can do this? I have looked through the API documentation within the "help" tab and don't see anything with this capability. Please let me know if I am missing something or how this can be done!
Thanks!!
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: API for performance metrics?

Post by pbroste »

Hello @lucas.shearer

Thanks for reaching out, the following will result in host and service status:

https://xxx.xxx.xxx.xxx/nagiosxi/help/a ... hoststatus
https://xxx.xxx.xxx.xxx/nagiosxi/help/a ... jects-host

Code: Select all

curl -XGET "https://xxx.xxx.xxx.xxx/nagiosxi/api/v1/objects/hoststatus?apikey=AEiMFttHuQRqWEDbqgXYelB6GPCakE3F7i6CKQsNIMoAS9Pcol3eE3Ohe5ejYUGH&pretty=1" -k
For service https://xxx.xxx.xxx.xxx/nagiosxi/help/a ... vicestatus
https://xxx.xxx.xxx.xxx/nagiosxi/help/a ... ts-service

Code: Select all

curl -XGET "https://xxx.xxx.xxx.xxx/nagiosxi/api/v1/objects/service?apikey=AEiMFttHuQRqWEDbqgXYelB6GPCakE3F7i6CKQsNIMoAS9Pcol3eE3Ohe5ejYUGH&pretty=1" -k
Please let us know if you have further questions,
Perry
Locked