Service acknowledgment and service dependency

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.
loopx
Posts: 4
Joined: Fri Aug 23, 2013 5:08 am

Service acknowledgment and service dependency

Post by loopx »

Hello everybody,


I'm working as system engineer and I'm the person responsible for our Nagios monitoring system (based on Nagios Core version 3.5.1).
I'm very happy with that version which works as expected.
We currently have more than 700 hosts for more than 4000 services.


I'm wondering if it was possible to auto-acknowledge a service if its dependency fails.

Let me explain our real situation :
- one host (srv-val0127)
- 2 services related to that host ("JBoss instance ACTIVE AJP/HTTP connectors" and "ACTIVE_THREAD")

I simply want to link both services :
- "ACTIVE_THREAD" is a passive check (from JBoss Operation Network which send traps to Nagios)
- I recently set the check freshness to detect if traps are still sent for that service
- "JBoss instance ACTIVE AJP/HTTP connectors" is an active check which is based on TCP (check for door HTTP/AJP to be open : custom check script)


When the JBoss instance is DOWN, no more trap are sent (of course ...) => Nagios execute the active check for "ACTIVE_THREAD" to tell me that no more trap seems to be send : "UNKNOWN: This check seems to no more receive traps from sender".

(in fact, I have 2 passives checks by instance, but for the exmple, we could speak only of 1 : enough)


So, when JBoss instance is DOWN, I get 2 checks with an issue :
- one WARN (or CRIT) => RED
- one UNKNOWN (trap) => ORANGE

I want to hide that "traps" check when the active check for HTTP/AJP fails. Is that possible ?
When instance is down for several days, I would like to only see the active check "JBoss instance ACTIVE AJP/HTTP connectors" failing, and hide all others (mainly passive check, for now).


Since we also have a console for the whole team (set to hide "acknowledged" services or "unreachable" host), I'm trying to hide those passive check by a kind of "auto-acknowledgment".

I tried doing this :

Code: Select all

#Little try
define servicedependency {
        dependent_host_name             srv-val0127
        dependent_service_description   ACTIVE_THREAD
        host_name                       srv-val0127
        service_description             JBoss instance ACTIVE AJP/HTTP connectors
        execution_failure_criteria      o,w,u,c,p,n
        notification_failure_criteria   o,w,u,c,p,n
        dependency_period               24x7
}
but I don't get expected result since I don't think that it will acknowledge the service (only suppress notification and active check).


So, is there any way to do what I'm trying to do ? It could be the 7th skies of Nagios :)


Thanks
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Service acknowledgment and service dependency

Post by sreinhardt »

There is definitely not a way to hide them from the interface, although that would be pretty cool. If I were in your position I would probably look at creating an event handler that will run on the dependency(http check in this case) and when down put the dependent service into downtime for a reasonable amount of time via the nagios cmd file or a call to the web interface.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
loopx
Posts: 4
Joined: Fri Aug 23, 2013 5:08 am

Re: Service acknowledgment and service dependency

Post by loopx »

Hi Sreinhardt,


Thanks you the response.

Do you have interesting links that could help to implement that solution ? I'm not familiar with service dependency, for now.


Thanks
loopx
Posts: 4
Joined: Fri Aug 23, 2013 5:08 am

Re: Service acknowledgment and service dependency

Post by loopx »

Hello,


I just read the release ntoe of Nagios 4 :

(http://nagios.sourceforge.net/docs/nagi ... tsnew.html)
--------
Services now support a parents attribute. A service parent performs a function similar to host parents and can be used in place of service dependencies in simple circumstances.
--------

With parent link, I could tag the service with a "unreachable", something like that ? And thus, should be able to hide it ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Service acknowledgment and service dependency

Post by slansing »

Hello Loopx, you can find diagrams, as well as examples on assigning service deps here:

http://nagios.sourceforge.net/docs/nagi ... ncies.html

Let me know if you have questions!
loopx
Posts: 4
Joined: Fri Aug 23, 2013 5:08 am

Re: Service acknowledgment and service dependency

Post by loopx »

I really want this, but for services : http://nagios.sourceforge.net/docs/3_0/ ... ility.html

Still no way with Nagios 4 ?
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Service acknowledgment and service dependency

Post by lmiltchev »

I believe you can only set up a "parent service" for a particular service in core 4.
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.
http://nagios.sourceforge.net/docs/nagi ... ml#service
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: Service acknowledgment and service dependency

Post by millisa »

Since what loopx is trying to do is semi similar to what I was trying to accomplish with the new 4.x service parents feature, I figured I'd repost the old forum link and mantis bug link. The overall gist is that the new parents attribute for services isn't suppressing notifications as expected.
Before you go doing a 3.5->4.x upgrade, you probably want to check out the discussion below:
Forum link with discussion and tests
and
Mantis Bug #0000562 about it

As of 4.0.7, the issue still exists in my tests. If you want to test it in your environment and if you get it to work using the new parents feature, I'd appreciate info on it.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Service acknowledgment and service dependency

Post by abrist »

Fixing bugs in new features is generally a priority, but until the load spike issues are fixed, this probably will not get looked at.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: Service acknowledgment and service dependency

Post by millisa »

Understood that the load issue takes priority. If the post above came off as whiney about the service parent issue, it was not intentional and my apologies (and considering this is the first related post I've seen on it since the bug report was filed, the service parents feature doesn't sound critical for most people). I was bringing it up more for the original poster to be aware of since it sounded like they were new to setting up service dependencies and the discussion mentioned the new service parents feature as a possible option.
Locked