What is the diff between state changes last/hard

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

What is the diff between state changes last/hard

Post 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
bwallace
Posts: 1146
Joined: Tue Nov 17, 2015 1:57 pm

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

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

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

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

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

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

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

Post 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.
Former Nagios employee
https://www.mcapra.com/
jspence
Posts: 28
Joined: Wed Jan 11, 2017 1:23 pm

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

Post by jspence »

Thank you so very much.
Please close this topic.

Thanks,
JSpence.
Locked