Page 1 of 1

last_hard_state vs state_type

Posted: Wed Jul 24, 2019 1:56 pm
by nagwindmon
team, please help me understand state_type value. when I executing API to check on host status I'm looking for last_hard_state and if its = 1, fire alert excluding 2 which mean host unreachable. But state_type is always = 1 regardless as far as I can see.
Please advise.

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 2:48 pm
by lmiltchev
This is what "state_type" means:
state_type = 0 is SOFT
state_type = 1 is HARD
Are you saying that your host is in a SOFT state, but you see:

Code: Select all

state_type = 1
in the REST API?

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 2:56 pm
by nagwindmon
what state_type value suppose to be when a new host being added and it is up running to start with?
yes, running REST API

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 3:06 pm
by lmiltchev
It should be:

Code: Select all

state_type = 1
provided the newly added host is in a HARD state.

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 3:12 pm
by nagwindmon
ok, got it. its still a bit confusing since it starts with 1 (hard state) then once issue has been detected it changes to 0 (soft) after x number of retires it goes back to 1 (hard) and stays so till another host state change occurs.

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 3:19 pm
by lmiltchev
This is by design. Let us know if you have any further questions or it's ok to close this topic. Thanks!

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 3:30 pm
by nagwindmon
I'm good, thank you, go ahead lock it.

Re: last_hard_state vs state_type

Posted: Wed Jul 24, 2019 3:45 pm
by mbellerue
Good to get that cleared up. Locking thread.