NRPE failure & Service notifications

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
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

NRPE failure & Service notifications

Post 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
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: NRPE failure & Service notifications

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
amprantino
Posts: 140
Joined: Thu Apr 18, 2013 8:25 am
Location: libexec

Re: NRPE failure & Service notifications

Post by amprantino »

Yes, this is what I was looking for.

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

Thank you
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: NRPE failure & Service notifications

Post by bwallace »

Glad to help! I'll lock this thread now.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked