Wrong Host State with dummy check

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Wrong Host State with dummy check

Postby davide.galletti.75 » Wed Sep 04, 2019 7:40 am

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
davide.galletti.75
 
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Re: Wrong Host State with dummy check

Postby scottwilkerson » Wed Sep 04, 2019 8:51 am

For hosts you want to pass 2 to check_dummy

Code: Select all
check_dummy!2!"the host is DOWN"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 16226
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Wrong Host State with dummy check

Postby davide.galletti.75 » Wed Sep 04, 2019 10:39 am

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.
davide.galletti.75
 
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Re: Wrong Host State with dummy check

Postby scottwilkerson » Wed Sep 04, 2019 12:08 pm

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

Here is the documentation for plugin Return Code
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/pluginapi.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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 16226
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Wrong Host State with dummy check

Postby davide.galletti.75 » Thu Sep 05, 2019 2:25 am

Thousand Thanks !!!

that was what i was looking for!

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

Cheers!
davide.galletti.75
 
Posts: 7
Joined: Thu Nov 08, 2012 9:34 am

Re: Wrong Host State with dummy check

Postby scottwilkerson » Thu Sep 05, 2019 8:29 am

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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 16226
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios XI

Who is online

Users browsing this forum: No registered users and 4 guests