Hello. I use $HOSTATTEMPT$ macro in my event handler. But this parameter not work when my host returns from soft DOWN state to soft UP state.
My situation(max_check_attempts value of 3):
Time=====Check #======State=====State type=====$HOSTATTEMPT$
= 0 ======== 1 ========= UP ======= HARD ========== 1
= 1 ======== 1 ======= DOWN ====== SOFT ========== 1
= 2 ======== 2 ========= UP ======= SOFT ========== 1
Why when the host is checked a second time in the SOFT mode $HOSTATTEMPT$ returns 1 but it should be 2?
Nagioc Core wrong returns $HOSTATTEMPT$.
Re: Nagioc Core wrong returns $HOSTATTEMPT$.
How i can contact with devs about this problem?
I think $HOSTATTEMPT$ have a bug, because $SERVICEATTEMPT$ macros work correctly and return 2 when service is obtain OK status from 2 attempts.
I tested this with nagios 4.4.3 and 4.4.6.
I think $HOSTATTEMPT$ have a bug, because $SERVICEATTEMPT$ macros work correctly and return 2 when service is obtain OK status from 2 attempts.
I tested this with nagios 4.4.3 and 4.4.6.
Re: Nagioc Core wrong returns $HOSTATTEMPT$.
What exactly is your event handler trying to do?
https://github.com/NagiosEnterprises/nagioscore/issues
https://assets.nagios.com/downloads/nag ... types.html
I'm specifically referring to the last 3 rows in the table, where instead of SOFT DOWN we're seeing a SOFT UNKNOWN (should have the same effect):
I'm not sure if hosts are meant to have a different concept of check# than services -- that's not really addressed in the documentation.
GitHub issues are the best way to report bugs:GemiX wrote:How i can contact with devs about this problem?
https://github.com/NagiosEnterprises/nagioscore/issues
Not sure -- the state types documentation indicates that the check#, which I think is meant to map to $HOSTATTEMPT$, should be 2 in this scenarion:GemiX wrote:Why when the host is checked a second time in the SOFT mode $HOSTATTEMPT$ returns 1 but it should be 2?
https://assets.nagios.com/downloads/nag ... types.html
I'm specifically referring to the last 3 rows in the table, where instead of SOFT DOWN we're seeing a SOFT UNKNOWN (should have the same effect):
Code: Select all
6 1 OK HARD Yes Service experiences a HARD recovery. Event handlers execute and a recovery notification is sent out.
7 1 OK HARD No Service is still OK.
8 1 UNKNOWN SOFT Yes Service is detected as changing to a SOFT non-OK state. Event handlers execute.
9 2 OK SOFT Yes Service experiences a SOFT recovery. Event handlers execute, but notification are not sent, as this wasn't a "real" problem. State type is set HARD and check # is reset to 1 immediately after this happens.
10 1 OK HARD No Service stabilizes in an OK state.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/