Service Dependency Help

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Service Dependency Help

Post by kwhogster »

Nagios Core 4.3

Trying to setup service dependency for each host so when the host is down I do not get alerted about all the services that are defined per host

So I started with one

Code: Select all

define servicedependency{
    host_name                           SERV011
    service_description                 Explorer
    dependent_host_name                 SERV011
    dependent_service_description       Explorer
    execution_failure_criteria          n
    notification_failure_criteria       w,u,c
    }
The error I get is

Processing object config file '/usr/local/nagios/etc/objects/servgrps.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/servicedependency.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/hostdependency.cfg'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 738 services.
Checked 49 hosts.
Checked 15 host groups.
Checked 27 service groups.
Checked 5 contacts.
Checked 2 contact groups.
Checked 49 commands.
Checked 13 time periods.
Checked 44 host escalations.
Checked 678 service escalations.
Checking for circular paths...
Checked 49 hosts
Error: Circular notification dependency detected for services 'SERV011;Explorer' and 'SERV011;Explorer'
Checked 17 service dependencies
Checked 24 host dependencies
Checked 13 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 1

***> One or more problems was encountered while running the pre-flight check...

Check your configuration file(s) to ensure that they contain valid
directives and data definitions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.


Any ideas

Thank you

Tom
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service Dependency Help

Post by cdienger »

The current config is saying that the Explorer service on host SERV011 is dependent on the Explorer service on host SERV011 which is dependent on the Explorer service on host SERV011 which is dependent on the Explorer service on host SERV011...etc...

You could make other services on the host dependent on the Exploerer service on host SERV011, but not itself. https://assets.nagios.com/downloads/nag ... ncies.html has details.

That said, services generally shouldn't be sending out notifications if the host goes down. There are cases where it can happen but shouldn't be the norm. See https://support.nagios.com/forum/viewto ... =7&t=33287 and https://support.nagios.com/forum/viewto ... 10#p103689. You may want to review the check and notification intervals of the host and service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Service Dependency Help

Post by kwhogster »

Thanks for the info Box293 posting was helpful I use his stuff on my network too

for my services they use the same template which sets the retry_interval = 2

My hosts use various templates depending on the OS but they all have retry_interval = 1

Should I adjust this?
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service Dependency Help

Post by cdienger »

What are the check intervals and max attempts set to typically for the hosts and services? It's really a matter of all three settings working together that determines when notifications are sent.

If there is a particular host/services that this is happening for that you can force into a down state, you could "tail -f /usr/local/nagios/var/nagios.log" and grep for them and watch as they go into soft then hard states and when notifications are sent. This could give you a better understanding on how the two interact.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Service Dependency Help

Post by kwhogster »

Hello

Check_interval varies from 60 to 10080 do not need to run checks on certain services all the time.

For Hosts
max_check_attempts = 10

Generic-service
max-attempts = 3

Thanks
Tom
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Service Dependency Help

Post by cdienger »

I would try swapping the values used for hosts and services for both retry interval and max attempts so services retry every minute up to 10 times and hosts retry every 2 minutes up to 3 times. That should help some since hosts will have a better chance of being detected as down before the service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kwhogster
Posts: 644
Joined: Wed Oct 14, 2015 6:51 pm
Location: Wood Ridge NJ USA
Contact:

Re: Service Dependency Help

Post by kwhogster »

things seem to be fine now

This can be locked

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

Re: Service Dependency Help

Post by scottwilkerson »

Glad to hear it was taken care of. Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked