Escalation with hostgroup and servicegroup

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
airw
Posts: 10
Joined: Thu Jan 08, 2015 6:12 am

Escalation with hostgroup and servicegroup

Post by airw »

Does anyone know if service escalations can be configured using both: servicegroup_name and hostgroup_name?

#serviceescalation.cfg

Code: Select all

define serviceescalation{
	     first_notification           0
        last_notification           1
        notification_interval      0
        contact_groups           admin
        escalation_period        24x7
        escalation_options      c,r    
        servicegroup_name     ping, temp-sensors 
        hostgroup_name         routers-only
        }
It works by notifying admin, however it does not seem to recognize neither - hostgroup_name nor servicegroup_name and sends all type of services and hosts - like both lines didn't exist.

Alternatively if I replace

Code: Select all

        servicegroup_name     ping, temp-sensors 
with

Code: Select all

        service_description	PING
This time it does work fine and escalates 'ping' service only for specific hosts 'routers-only'.
Just wondering why it cannot grab the servicegroup instead.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Escalation with hostgroup and servicegroup

Post by tmcdonald »

Could possibly be a bug. What version of Core are you using?

Strictly speaking, according to the docs the servicegroup_name directive is not listed as a valid option for either Core 3 or Core 4:

http://nagios.sourceforge.net/docs/3_0/ ... escalation
http://nagios.sourceforge.net/docs/nagi ... escalation
Former Nagios employee
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Escalation with hostgroup and servicegroup

Post by jdalrymple »

So a servicegroup defines the grouping of hosts - it just does:
Core Objects wrote:The format of the member directive is as follows (note that a host name must precede a service name/description)
I guess then the question is you're trying to further filter down the results? You'll probably have to specify a new servicegroup such as ping-routers-only.

What does the escalations definition end up looking like in objects.cache?
airw
Posts: 10
Joined: Thu Jan 08, 2015 6:12 am

Re: Escalation with hostgroup and servicegroup

Post by airw »

What version of Core are you using?
I'm sorry, I should have told that this is Icinga 1.12
I know that all directives are fine.
If this is not relevant, the thread can be closed, but really, I was looking for nagios/icinga logic I might be missing.
What does the escalations definition end up looking like in objects.cache?
There is no object.cache unfortunately.
Core Objects wrote:
The format of the member directive is as follows (note that a host name must precede a service name/description)
Did that and it helped a little.
Now it recognizes 'servicegroup_name' but it sends notification for all hosts (still not recognizing 'hostgroup_name' of routers-only).
you're trying to further filter down the results?
That's correct.

Briefly:
When I have: 'servicegroup_name' and 'hostgroup_name' directives it sends notifications for services I want but for all hosts.
When I have: 'description_name' and 'hostgroup_name' it links both hostgroups and a service from the directive.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Escalation with hostgroup and servicegroup

Post by jdalrymple »

airw wrote:There is no object.cache unfortunately.
Wow - They've really went a different direction with that other project apparently. If it's that wildly different then I doubt our boards are the right place to troubleshoot, I'd head over to the boards for Icinga.
airw wrote:
you're trying to further filter down the results?
That's correct.
With that said - the right way to do this would be to create separate servicegroups based on hostgroups. I'm thinking you want to create multiple groupings, but only at the escalations level. My guess is that the logic to do this isn't in the product - it's not really sound logic. The grouping should be done in the groups, not in the notifications.
airw
Posts: 10
Joined: Thu Jan 08, 2015 6:12 am

Re: Escalation with hostgroup and servicegroup

Post by airw »

Thanks for following up.
At this stage all I'd like to know is if this configuration would work in Nagios.
The grouping should be done in the groups, not in the notifications.
I wouldn't call that grouping. I just want to tell nagios/icinga to notify me (escalate to me) in case of the service 1 is down on host 1 and don't bother me if the service 2 is down on host 2 but keep monitoring though.

Directives "servicegroup" and "hostgroup" are there in nagios/icinga documentation (escalation part) and it should work. I wonder why it doesn't.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Escalation with hostgroup and servicegroup

Post by jdalrymple »

airw wrote:Directives "servicegroup" and "hostgroup" are there in nagios/icinga documentation (escalation part) and it should work. I wonder why it doesn't.
Can you point us to where our documentation on servicegroups in escalations is? If you can point us to it we'll see about getting it removed - it really shouldn't be there since in our minds it yields unpredictable results.
airw
Posts: 10
Joined: Thu Jan 08, 2015 6:12 am

Re: Escalation with hostgroup and servicegroup

Post by airw »

jdalrymple wrote: If you can point us to it we'll see about getting it removed - it really shouldn't be there
Couldn't find it. Must have been in Icinga docs.
This thread can be closed.
Thank you both for the effort anyway.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Escalation with hostgroup and servicegroup

Post by jdalrymple »

You bet - I'll lock it up.

I hate leaving things unresolved though so I just want to re-mention that a servicegroup always implies a hostgroup (of some sort, not a hostgroup definition proper). When you are creating a servicegroup each service has to be associated to a host. The status of any service is useless without the context of the host. If you wish to attach a servicegroup to a hostgroup - the proper way is to include both of them in a "define service{" definition.

Locking thread now.
Locked