Page 1 of 1

Passive Host doesnt change to "unreachable"

Posted: Tue Jun 18, 2019 3:21 am
by SSFFU
Hi,
I'm using NAGIOS XI with NSCA Server and NSClient++ passive host.

I configured passive host and passive service with:
'check_dummy' - "SERVICE UNREACHABLE" or "HOST UNREACHABLE"
Active check OFF
Passice Check ON
Freshness threshold 300
Check Freshness ON

When I stop the comunication beetwen the Host and the NSCA Server, the Services became "SERVICE UNREACHABLE", but the Host doesn't change the state and remain "green - up".

Does anyone know what the problem may be?
Thanks in advance
Francesco

Re: Passive Host doesnt change to "unreachable"

Posted: Tue Jun 18, 2019 2:36 pm
by cdienger
The first argument that the check_dummy plugin accepts will determine the state. See page 10 of https://assets.nagios.com/downloads/nag ... ios-XI.pdf for an example(it's of a service config but the same is true for host configs).

Re: Passive Host doesnt change to "unreachable"

Posted: Wed Jun 19, 2019 1:04 am
by SSFFU
Thanks cdienger.
I used this document for the configuration of passive hosts/services.
The problem is that the Services correctly became SERVICE UNREACHABLE, while the Hosts doesn't change state.

Re: Passive Host doesnt change to "unreachable"

Posted: Wed Jun 19, 2019 2:43 pm
by lmiltchev
Can you show us the actual host config?

Re: Passive Host doesnt change to "unreachable"

Posted: Thu Jun 20, 2019 1:39 am
by SSFFU
here you are

[root@mon hosts]# cat CEP_TGSRV01.cfg
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 2.7.4
# Date: 2019-06-19 12:31:54
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
host_name CEP_TGSRV01
use xiwizard_passive_host
address CEP_TGSRV01
check_command check_dummy!2!"HOST UNREACHABLE"!!!!!!
max_check_attempts 3
check_interval 5
retry_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period 13x5
check_freshness 1
freshness_threshold 60
contact_groups GRP_Alert
notification_interval 0
notification_period 13x5
notification_options d,u,
notifications_enabled 1
stalking_options n,
icon_image passiveobject.png
statusmap_image passiveobject.png
_xi_passive_firstcheck 1560852804
_xi_passive_gen 1560852804
register 1
}

###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################

Re: Passive Host doesnt change to "unreachable"

Posted: Thu Jun 20, 2019 10:27 am
by lmiltchev
I tested a similar config and it worked for me just fine. There are a couple of things that you need to check:

1. Make sure that checking host freshness is actually enabled in the main config. Open /usr/local/nagios/etc/nagios.cfg in a text editor and set:

Code: Select all

check_host_freshness=1
save, exit and restart nagios:

Code: Select all

service nagios restart
Wait for a minute or two, then see if the state/output is going to change in the GUI.

2. Make sure that the "13x5" timeperiod is not the issue. I don't know how it's defined, so cannot test that. I used 24x7, FYI.

Re: Passive Host doesnt change to "unreachable"

Posted: Thu Jun 20, 2019 10:57 am
by SSFFU
Thanks lmiltchev,
I confirm You that the parameters 'check_host_freshness' was on 0!
Changed it to 1 the hosts became "UNREACHABLE".
Thank you the problem is solved.
Bye
F.

Re: Passive Host doesnt change to "unreachable"

Posted: Thu Jun 20, 2019 11:00 am
by lmiltchev
I am glad I was able to help! :)