Page 1 of 1

Multiple service dependencies

Posted: Thu Sep 06, 2012 3:07 am
by TSCAdmin
Dear Nagios support,

We are using SNMP to monitor most of our Linux infrastructure.

To avoid raising and sending multiple alerts if SNMP failed or stopped we defined servicedependencies, example:

Code: Select all

define servicedependency {
       dependent_host_name                      server1.example.com
       dependent_service_description            atd,Cron,Disk Monitor,ntpd,syslog,sysstat,xinet
       host_name                                server1.example.com
       service_description                      SNMP
       inherits_parent                          1
       execution_failure_criteria               w
       notification_failure_criteria            w,u,c
}
Now, we are going to implement NRPE too to monitor additional services. Again, if NRPE fails we don't want to raise multiple alerts but only one stating that NRPE has failed. I tried to import the service dependency file with following config:

Code: Select all

define servicedependency {
       dependent_host_name                      server1.example.com
       dependent_service_description            Current Users,Disk Monitor /boot,Load Average
       host_name                                server1.example.com
       service_description                      NRPE
       inherits_parent                          1
       execution_failure_criteria               w
       notification_failure_criteria            w,u,c
}
When I checked servicedependencies.cfg file it kept only the first version and NRPE dependency was missing. I tried again by putting both the configurations in the same file and imported again. Unfortunately, it did not work this time too and kept only the SNMP dependency version.

I understand that one way to overcome this is:

Code: Select all

CCM -> Advanced -> Service Dependencies -> Add New -> and then use different config name
but this is not a good solution in my case since we have got over 500 servers and it would take lifetime to define all the service dependencies.

Is there another way to fix this by being able to define multiple service dependencies for a host?

Thanks in advance.

Re: Multiple service dependencies

Posted: Thu Sep 06, 2012 8:59 am
by scottwilkerson
Just to clarify you do have all of the services that are specified in the new dependency already configured correct?

Is all of the capitalization correct?

Re: Multiple service dependencies

Posted: Fri Sep 07, 2012 2:16 am
by TSCAdmin
That is correct, Scott. We do have all the services in the new dependency being configured and monitored. The capitalization is also correct for NRPE and the dependent services. I just verified it again.

Is there any other information required from my side?

Thanks

Re: Multiple service dependencies

Posted: Fri Sep 07, 2012 12:28 pm
by scottwilkerson
Just to clarify, are you importing them by placing them in the /usr/local/nagios/etc/import directory?

And if so, can you also clarify that you are able to successfully apply configuration without errors at
Configure -> CCM -> Apply Configuration

Re: Multiple service dependencies

Posted: Fri Sep 07, 2012 1:52 pm
by TSCAdmin
scottwilkerson wrote:Just to clarify, are you importing them by placing them in the /usr/local/nagios/etc/import directory?
Yes that is correct, I imported the configurations mentioned in my first post. Firstly, one by one and secondly both of them together.
scottwilkerson wrote:And if so, can you also clarify that you are able to successfully apply configuration without errors at
Configure -> CCM -> Apply Configuration
The apply configuration finished without any errors, so the configuration was applied successfully.

How do we resolve this?

Re: Multiple service dependencies

Posted: Fri Sep 07, 2012 3:04 pm
by scottwilkerson
I have confirmed there is a bug in the way the importer imports service dependencies, and have posted a bug to our tracker
http://tracker.nagios.com/view.php?id=289

As a solution for the time being you can place your dependency files (that you wanted to import) in the /usr/local/nagios/etc/static directory for the time being and they will be used by Nagios, you just will not be able to modify them in the editor.