Page 1 of 2

Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 6:24 am
by mkeey
We have several services defined to hosts. When there is a threshold violation, the services alert as desired. When a host is unavailable in the network the host alerts as desired. However, it appears that at times services alert when a host is unavailable. So, we end up getting service alerts and a host alert which are somewhat redundant and unwanted. Are/Should services be dependent on hosts and if so why are we getting these unwanted alerts. If they aren't... they should be! Then how can I remedy the situation?

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 10:18 am
by benjaminsmith
Hi @mkeey,

You can use service dependency to limit unwanted notifications when a master host is down or unreachable. To setup these relationships go to Configure > CCM > Advanced > Service Dependencies.

Take a look at the following guide for more details:
https://support.nagios.com/kb/article/n ... s-505.html

All services are associated with a host in Nagios, and it's possible to disable checks when the host is down on a system basis in the main configuration file (/usr/local/nagios/etc/nagios.cfg) :

Code: Select all

host_down_disable_service_checks=1
Let us know you have further questions.

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 11:20 am
by mkeey
Thank you! That is great information. I'm thinking going the CFG file update would be the best and easiest way to do this. However, I'm unsure where in the CFG file this should be placed. Noticed a few "headings"...
# MODIFIED
# NDOUtils module
# PNP settings - bulk mode with NCPD
# service performance data
# host performance data
# OBJECTS - UNMODIFIED
# STATIC OBJECT DEFINITIONS (THESE DON'T GET EXPORTED/IMPORTED BY NAGIOSQL)
# OBJECTS EXPORTED FROM NAGIOSQL
# GLOBAL EVENT HANDLERS
# UNMODIFIED

Where should I code the "host_down_disable_service_checks=1"??

Secondly, when we perform an upgrade of the XI, will this setting get overwritten?


Thanks,
Martin

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 11:43 am
by scottwilkerson
mkeey wrote:Where should I code the "host_down_disable_service_checks=1"??
It would get set in /usr/local/nagios/etc/nagios.cfg
mkeey wrote:Secondly, when we perform an upgrade of the XI, will this setting get overwritten?
No, we would never modify this setting on upgrade

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 12:53 pm
by mkeey
I think we have a misunderstanding. I know the setting should be defined in the nagios.cfg file. My question is where in the CFG file should the parameter be coded? Can it be placed anywhere? At the beginning, ending, or after one of the # fields?

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 1:04 pm
by scottwilkerson
mkeey wrote:I think we have a misunderstanding. I know the setting should be defined in the nagios.cfg file. My question is where in the CFG file should the parameter be coded? Can it be placed anywhere? At the beginning, ending, or after one of the # fields?
It can be placed anywhere, however make sure you don't have another host_down_disable_service_checks in the file with different settings.

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 1:28 pm
by mkeey
Agreed. Performed the following check...

[nagios@mlwnag12]:[/usr/local/nagios/etc]# ls
cgi.cfg contacts.cfg hostescalations.cfg hosts nagios.cfg nrpe nrpe.cfg.save recurringdowntime.cfg servicedependencies.cfg servicegroups.cfg static
commands.cfg contacttemplates.cfg hostextinfo.cfg hosttemplates.cfg ndo2db.cfg nrpe.cfg nsca.cfg resource.cfg serviceescalations.cfg services timeperiods.cfg
contactgroups.cfg hostdependencies.cfg hostgroups.cfg import ndomod.cfg nrpe.cfg.rpmnew pnp send_nsca.cfg serviceextinfo.cfg servicetemplates.cfg

[nagios@mlwnag12]:[/usr/local/nagios/etc]# grep host_down_disable_service_checks nagios.cfg

[nagios@mlwnag12]:[/usr/local/nagios/etc]#

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 3:04 pm
by npolovenko
@mkeey, What version of XI are you running? The following option became avaliable in Core 4.1.0 or XI 5.5 +
host_down_disable_service_checks
Please upgrade XI to the latest version:
https://assets.nagios.com/downloads/nag ... ctions.pdf

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 3:11 pm
by jvaira
Would setting host_down_disable_service_checks=1 affect a bpi for down hosts?

Re: Are Services Dependent on Hosts

Posted: Wed Mar 27, 2019 4:30 pm
by npolovenko
@jvaira, If you enable the option, the services will remain in whatever state they were in before the host went down. So if some services were in OK state they are going to stay in OK state until the host recovers. Versus if you don't have this option enabled all services will eventually go down(critical) because the host is down. This difference could probably affect the BPI group health but I'd recommend testing this out in your environment.