Page 1 of 1

What is the diff between state changes last/hard

Posted: Tue Feb 28, 2017 8:29 am
by jspence
Hello,

What is the difference between last_state_change and last_hard_state_change?
They are columns found in one of the tables produces by NDOUtils.

Thank,
JSpence

Re: What is the diff between state changes last/hard

Posted: Tue Feb 28, 2017 3:20 pm
by bwallace
I'd attempt to describe it in detail here, but we have a doc which does that:
https://assets.nagios.com/downloads/nag ... types.html

Hopefully that clears things up for you but of course let us know if you have any additional questions.

Re: What is the diff between state changes last/hard

Posted: Wed Mar 01, 2017 8:26 am
by jspence
Thank you for the link. It was very helpful.
Another question on the topic is:
What is 'usec' as used in last_hard_state?

Re: What is the diff between state changes last/hard

Posted: Wed Mar 01, 2017 4:27 pm
by mcapra
You might find this documentation useful. It describes all the entire NDOUtils database model:
https://assets.nagios.com/downloads/nag ... _Model.pdf

Could you clarify what you're referring to with last_hard_state and usec? A lot of the _usec fields aren't directly related to the Nagios state of an object.

Re: What is the diff between state changes last/hard

Posted: Thu Mar 02, 2017 3:20 pm
by jspence
> Could you clarify what you're referring to with last_hard_state and usec?
> A lot of the _usec fields aren't directly related to the Nagios state of an object.

In the MySQL database tables created by NDOUtils most of the time related rows have a corresponding row entitled 'usec'. They are not consistent with time in that if time increases every (let's say every minute), the usec might go up, or down ( probably wrapping). I was just wondering if anyone had any idea as to what they were since I can't seem to figure it out.

Thanks.

Re: What is the diff between state changes last/hard

Posted: Thu Mar 02, 2017 4:25 pm
by mcapra
Ah, the _usec fields are included for additional granularity. They represent the microseconds of a corresponding _time field. Where as a traditional unix timestamp only goes down to the nearest second, it might be useful in some situations to have the microsecond as well. Particularly in large environments that have several thousand checks, having additional granularity on "when" something occurred in Nagios can be useful.

Re: What is the diff between state changes last/hard

Posted: Fri Mar 03, 2017 1:54 pm
by jspence
Thank you so very much.
Please close this topic.

Thanks,
JSpence.