Backend api - getservicestatus

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
arul_anand_2000
Posts: 3
Joined: Thu Dec 10, 2015 3:42 am

Backend api - getservicestatus

Post by arul_anand_2000 »

Hi,

I had increased the max service check age to 600 minutes from 5 minutes in Ndoutils as i want data for analysis exported to external system. I am using url - http://10.168.18.151/nagiosxi/backend/? ... t=6bm9jkb0 to pull data from Nagios server and it works perfectly. Is there a way to specify start time and end time to url to get only the specific data. Is there any document which specifies the list of arguments that can be passed to getservicestatus command.

Thanks in Advance.

Regards,
Arul.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Backend api - getservicestatus

Post by rkennedy »

arul_anand_2000 wrote:Is there a way to specify start time and end time to url to get only the specific data.
Are you looking for a past result of a service check or a graph? I'm a bit confused on this part, can you clarify what you're looking to do?
arul_anand_2000 wrote:Is there any document which specifies the list of arguments that can be passed to getservicestatus command.
Check out page 4 @ https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Also, take a look at the file /usr/local/nagiosxi/html/backend/index.php.

Is that the information you're looking for?
Former Nagios Employee
arul_anand_2000
Posts: 3
Joined: Thu Dec 10, 2015 3:42 am

Re: Backend api - getservicestatus

Post by arul_anand_2000 »

Thanks for the update rkennedy. To be more specify we are trying build an analytical system which will use metrics data like CPU, Memory usage etc. We want to get the data from Nagios to Analytical system. In case of Nagios open source there tables from which we pull the historical data. In case of Nagios XI those tables were not updated. We were using getServiceStatus API to get the current data and send it other system. The problem is if there is down time in Other system metric data is lost. We wanted to know if there is a way to pull the historical data by specifying start and end time. We are not looking for embedded graph but for past service check data for all hosts and metrics in one single api call. Is there a way to achieve it.

Regards,
Arul.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Backend api - getservicestatus

Post by rkennedy »

At this time, there is not a way to pull historical data. To further use it though, you can specifiy a few more fields to narrow down the results you receive from getservicestatus.

?cmd=getservicestatus&host_name=localhost&service_description=Ping - example of other variables that can be used with it.
Former Nagios Employee
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Backend api - getservicestatus

Post by rkennedy »

I asked the developers about a function that I found, 'gethistoricalservicestatus'. Currently it's not working properly.

I was informed that 'gethistoricalservicestatus' should be fixed for the next minor release - at that point you'll be able to use that for historical data.
Former Nagios Employee
arul_anand_2000
Posts: 3
Joined: Thu Dec 10, 2015 3:42 am

Re: Backend api - getservicestatus

Post by arul_anand_2000 »

Thanks a lot for the update. Can you please let me know when this minor release would be available. Can we get this as a patch if we contact support.

Regards,
Arul.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Backend api - getservicestatus

Post by rkennedy »

At this time I do not have an estimate on when the next minor release will occur as it's in the developers hands.

As for a patch, you'll just have to wait for the release.
Former Nagios Employee
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Backend api - getservicestatus

Post by awilson »

Was this update eventually released? If so, which version?

Thanks!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Backend api - getservicestatus

Post by rkennedy »

There has been an update since then, and gethistoricalservicestatus appears to be working after what I just tested.

This is showing me a past state -

Code: Select all

http://192.168.4.254/nagiosxi/backend/?cmd=gethistoricalservicestatus&ticket=tickettest&username=nagiosadmin&host_name=rkennedy.nagios.local&name=Uptime
While this shows me current -

Code: Select all

http://192.168.4.254/nagiosxi/backend/?cmd=getservicestatus&username=nagiosadmin&ticket=tickettest&host_name=rkennedy.nagios.local&name=Uptime
I'm running 5.2.5 on this machine. Are you seeing issues @awilson?
Former Nagios Employee
awilson
Posts: 224
Joined: Mon Mar 21, 2016 1:20 pm

Re: Backend api - getservicestatus

Post by awilson »

No issues. Thanks!
Locked