Page 1 of 2
Backend api - getservicestatus
Posted: Tue Dec 15, 2015 1:23 pm
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.
Re: Backend api - getservicestatus
Posted: Tue Dec 15, 2015 2:26 pm
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?
Re: Backend api - getservicestatus
Posted: Tue Dec 15, 2015 9:02 pm
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.
Re: Backend api - getservicestatus
Posted: Wed Dec 16, 2015 4:28 pm
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.
Re: Backend api - getservicestatus
Posted: Wed Dec 16, 2015 4:36 pm
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.
Re: Backend api - getservicestatus
Posted: Wed Dec 30, 2015 12:13 am
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.
Re: Backend api - getservicestatus
Posted: Wed Dec 30, 2015 10:40 am
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.
Re: Backend api - getservicestatus
Posted: Mon Mar 21, 2016 3:08 pm
by awilson
Was this update eventually released? If so, which version?
Thanks!
Re: Backend api - getservicestatus
Posted: Mon Mar 21, 2016 4:32 pm
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?
Re: Backend api - getservicestatus
Posted: Tue Apr 05, 2016 5:45 pm
by awilson
No issues. Thanks!