objects/statehistory API data

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

objects/statehistory API data

Post by meganwilliford »

I am noticing in the objects/statehistory API some data that seems like should be in there is not. It looks like only the past 24 hrs of data appears in the API, is that correct? And what isn't appearing is if a service state has been in a critical status for > 24 hrs but the last check was 5 minutes ago and is still critical, that last state does not appear in the API. Is that the right behavior?

Example of what isn't reporting to the objects/statehistory API:

Service status for: ntpd
Service State: Critical
Duration: 1d 23h 22m 3s
Service Stability: Unchanging (stable)
Last Check: 2019-12-11 12:59:41
Next Check: 2019-12-11 13:02:01
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: objects/statehistory API data

Post by lmiltchev »

Can you show us your actual API call and the output of it? Are you passing a "starttime" or you are using the "default" timestamp (Default: -24 hours)?
example01.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Re: objects/statehistory API data

Post by meganwilliford »

We have the default -24hr. I think I get it now... so only state changes get reported and if it hasn't changed within 24 hrs then there won't be anything new in the API?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: objects/statehistory API data

Post by lmiltchev »

Yes, without passing a starttime this REST API call would only show the last 24 hours of state changes. Let us know if you have any further questions. Thanks!
Be sure to check out our Knowledgebase for helpful articles and solutions!
meganwilliford
Posts: 101
Joined: Tue Aug 06, 2019 7:49 am

Re: objects/statehistory API data

Post by meganwilliford »

Thanks! You can lock this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: objects/statehistory API data

Post by lmiltchev »

You are welcome! Locking it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked