Page 1 of 1

API Service uptime

Posted: Thu Oct 06, 2016 8:16 am
by reidara
Hello

I have looked at the REST API's in Nagios IX.
I havent found any useful to give me uptime / availability of service groups / hosts . Is that a missing parameter ?

BR,

Reidar

Re: API Service uptime

Posted: Thu Oct 06, 2016 3:56 pm
by rkennedy
You can query the API for information on all of your hosts by using a command like this -

Code: Select all

http://192.168.3.115/nagiosxi/api/v1/objects/hoststatus?apikey=32klfcka&pretty=1
If you wanted to dive into a specific host, just append the name= field to the end -

Code: Select all

http://192.168.3.115/nagiosxi/api/v1/objects/hoststatus?apikey=32klfcka&pretty=1&name=Host1
For service groups, it would be - http://192.168.3.115/nagiosxi/api/v1/ob ... a&pretty=1

As for Uptime, this isn't going to be currently possible through the Rest API. I filed a feature request for it, ID #9706.

Re: API Service uptime

Posted: Fri Oct 07, 2016 1:54 am
by reidara
Thank you for the info.

I have been digging around in the API a little now..

I cant find anything useful to generate my own uptime/availability out of using the API. That is a problem....

My need is to generate a report of service group availability last 30 days using an API.

BR,

Reidar

Re: API Service uptime

Posted: Fri Oct 07, 2016 11:06 am
by dwhitfield
Have you looked through the plugins at https://exchange.nagios.org/directory/P ... ics/Uptime ?

Re: API Service uptime

Posted: Mon Oct 17, 2016 1:35 am
by reidara
I really want to do all integration with API ( JSON REST ) for compatibility with upgrades of the product.

It seems like Nagios XI is missing information that could be useful in the REST methods.

BR

Re: API Service uptime

Posted: Mon Oct 17, 2016 10:39 am
by dwhitfield
As of right now, FR 9706 is pending approval, so I can't really say to wait for 5.4.0. Feel free to pop back in and ask about the status at any time.