Page 1 of 1

NRPE failure & Service notifications

Posted: Thu Jul 21, 2016 7:16 am
by amprantino
Hello all,

I have various hosts monitored by NRPE.
Then I defined a service checking NRPE availability named NRPE_listener

Is there a way, when any other service fails, first to check if NRPE_listener service is OK for this host?
If it is down, I would like to receive only one notification and suspend all other until NRPE_listener recovers.

Unfortunately the * is not applicable :(

Code: Select all

define servicedependency{
        dependent_host_name             testpc
        dependent_service_description   *
        host_name                       testpc
        service_description             NRPE_Listener
        execution_failure_criteria      n
        notification_failure_criteria   w,u,c
}
Error: Service dependency definition for service 'NRPE_Listener' on host 'testpc' is circular (it depends on itself)!
Error: Service dependency definition for service 'NRPE_Listener' on host 'testpc' is circular (it depends on itself)!

Can this be done somehow?
I don't want to create numerous definitions and update it for each new host/service

Re: NRPE failure & Service notifications

Posted: Thu Jul 21, 2016 9:56 am
by bwallace
Perhaps you could instead define the 'check NRPE listener' service as parent service, instead of going the service dependency route. I believe that by defining a parent service you avoid the circular problem you mentioned.

https://assets.nagios.com/downloads/nag ... ml#service

Parents --
This directive is used to define a comma-delimited list of short names of the "parent" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the "parents" directive. More complex service dependencies may be specified with service dependency objects.

Re: NRPE failure & Service notifications

Posted: Fri Jul 22, 2016 3:34 am
by amprantino
Yes, this is what I was looking for.

It was introduced in v4, so I have to upgrade also :-)

Thank you

Re: NRPE failure & Service notifications

Posted: Fri Jul 22, 2016 9:26 am
by bwallace
Glad to help! I'll lock this thread now.