Page 1 of 1

state changes of a host in last 60 minutes

Posted: Wed Mar 28, 2012 2:51 am
by cskang
Is there any way to find out the state changes of a host in last 60 minutes?
For example, there are five state changes if the state of a host changed as follow:
UP-->DOWN-->UP-->DOWN-->UP-->DOWN
I will need to know the initial state and the final state of the host due to the state change and when the state change has occurred for each state change.

Is there backendURL API (or any other means) to obtain such history of state changes for a host?

Re: state changes of a host in last 60 minutes

Posted: Wed Mar 28, 2012 8:49 am
by scottwilkerson
State history is available in the Reports section, but the minimum is 24 hours.

We do have a backend API component that can pull the state history but it doesn't filter by date/time.
http://exchange.nagios.org/directory/Ad ... nt/details

http://exchange.nagios.org/directory/Do ... PI/details

Also, it is undocumented yet, however, you can filter the results by host_name and service description by appending the following to the api URL

Code: Select all

&host_name=<YOUR_HOST>&service_description=<YOUR_SERVICE_DESCRIPTION>