naemon / naemon-core

Networks, Applications and Event Monitor
http://www.naemon.io/
GNU General Public License v2.0
154 stars 63 forks source link

What is use_aggressive_host_checking? #278

Open nook24 opened 5 years ago

nook24 commented 5 years ago

Maybe I'm just missing something but is there a documentation available of what use_aggressive_host_checking is doing? naemon.cfg suggests to check out the source code which is not helpful at all.

The reason i ask is. I created a check plugin like this for my host check:

#!/bin/bash
echo "This host is down"
exit 1

My Host was always current_state=0 Up. It took me two hours to find out that use_aggressive_host_checking=0 was the reason for this, so what the heck is this option about? Tested with Naemon 1.0.7 and 1.0.8.

From the docs: Naemon tries to be smart. Is always Up really that smart? :)

sni commented 5 years ago

well, the reason is that naemon considers warnings as ok for host checks. Consider a Ping which results in a few packets lost so check_ping results in a warning. So Naemon assumes the host is still up, because a host can either be up or down and you either cut the line between ok and warning or warning and critical.

sni commented 5 years ago

But i agree, instead of letting people read the source, we could simply write into the docs, that warnings are considered UP for hosts unless you use this option.

nook24 commented 5 years ago

From the docs:

Plugin Return Code Service State Host State
0 OK UP
1 WARNING UP or DOWN/UNREACHABLE*
2 CRITICAL DOWN/UNREACHABLE
3 UNKNOWN DOWN/UNREACHABLE

State 1: UP or DOWN/UNREACHABLE* This sounds like Schrödinger's host state^^

Until now i thought Host states: 0 = Up 1 = Down 2 = Unreachable

Service states: 0 = Ok 1 = Warning 2 = Critical 3 = Unknown

May be a better name would be use_service_exit_codes_for_host_states instead of use_aggressive_host_checking ?