Wrong Host State with dummy check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
davide.galletti.75
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Wrong Host State with dummy check

Post by davide.galletti.75 »

Hi All,

I have a NagiosXI demo (free) edition for testing in our lab and stumbled upon a strange behavior.

I've created different dummy host with:
name: dummy xx
IP: 127.0.0.1
check_command: check_dummy

now for testing I'm passing to the check_command the params "1" and "the host is DOWN"
(check_dummy!1!"the host is DOWN")

but in nagios (tatical view or host, host problems etc) the host always shows up as "UP" (OK).

what am I missing ?

Thanks,
Davide
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Wrong Host State with dummy check

Post by scottwilkerson »

For hosts you want to pass 2 to check_dummy

Code: Select all

check_dummy!2!"the host is DOWN"
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
davide.galletti.75
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Re: Wrong Host State with dummy check

Post by davide.galletti.75 »

Yes, that's right ... for UNREACHABLE .... but why is 1=DOWN not working ?

from docs i see:
$HOSTSTATEID$ A number that corresponds to the current state of the host: 0=UP, 1=DOWN, 2=UNREACHABLE.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Wrong Host State with dummy check

Post by scottwilkerson »

You are confusing the $HOSTSTATEID$ macro with plugin Return Code

Here is the documentation for plugin Return Code
https://assets.nagios.com/downloads/nag ... inapi.html
Return Code

Note: If the use_aggressive_host_checking option is enabled, return codes of 1 will result in a host state of DOWN or UNREACHABLE. Otherwise return codes of 1 will result in a host state of UP. The process by which Nagios Core determines whether or not a host is DOWN or UNREACHABLE is discussed here.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
davide.galletti.75
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Re: Wrong Host State with dummy check

Post by davide.galletti.75 »

Thousand Thanks !!!

that was what i was looking for!

once set use_aggressive_host_checking = 1 I'm getting may host down event.

Cheers!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Wrong Host State with dummy check

Post by scottwilkerson »

davide.galletti.75 wrote:Thousand Thanks !!!

that was what i was looking for!

once set use_aggressive_host_checking = 1 I'm getting may host down event.

Cheers!
Great!

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked