Hostgroups and servicegroups escalation not working

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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Hostgroups and servicegroups escalation not working

Post by eloyd »

Simple service escalations using hostgroups and servicegroups in Nagios Core 4.1.1 isn't working. I see conflicting results in the forums that it should or shouldn't. Documentation at https://assets.nagios.com/downloads/nag ... escalation says nothing about a servicegroup_name or servicegroups parameter (source code shows it's looking for servicegroup, servicegroups, or servicegroup_name).

However, documentation at https://assets.nagios.com/downloads/nag ... escalation says it's possible (search for "All Services In Multiple Servicegroups").

So if I do the following, I get a valid escalation (yes, "eloyd" is a valid contact):

Code: Select all

define serviceescalation{
        hostgroup_name          public
        service_description     Port:80
        first_notification      2
        last_notification       0
        notification_interval   30
        contacts                eloyd
        }
If I change service_description to servicegroup_name or servicegroups, I get an invalid config check result:

Code: Select all

define serviceescalation{
        hostgroup_name          public
        servicegroups           Ports
        first_notification      2
        last_notification       0
        notification_interval   30
        contacts                eloyd
        }

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
So which is it, and how can I get it to work? And why isn't it spewing out an appropriate error during the verification run?
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Hostgroups and servicegroups escalation not working

Post by lmiltchev »

The example from the second link shows that you need to use the "servicegroup_name" directive...
define serviceescalation{
servicegroup_name SERVICEGROUP1,SERVICEGROUP2,...,SERVICEGROUPN
other escalation directives ...
}
but you are using "servicegroups"...
define serviceescalation{
hostgroup_name public
servicegroups Ports
first_notification 2
last_notification 0
notification_interval 30
contacts eloyd
}
Can you try changing that to see if this is going to fix the issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Hostgroups and servicegroups escalation not working

Post by eloyd »

If I change service_description to servicegroup_name or servicegroups, I get an invalid config check result:
I may not have made this clear, but if I do servicegroups, servicegroup, servicegroup_name, servicegroups_name, or servicegroup_names, it doesn't work. Basically, if I use anything that shows in the sourcecode, I get an error but no information about that error. If I use something that doesn't show up in the source code (such as "servicegroup_names") then I get a normal error:

Code: Select all

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Invalid serviceescalation object directive 'servicegroup_names'.
Error: Could not add object property in file '/usr/local/nagios/etc/sv/sv_escalations.cfg' on line 3.
   Error processing object config files!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Hostgroups and servicegroups escalation not working

Post by lmiltchev »

OK, it seems like the problem is in Nagios XI as at the moment, there is no "service group" option available under the "Service Escalation Management". Other words, the only way to make the "time-saving" tricks work (All Services In Multiple Servicegroups) in XI is to put your config in the static.

I tested the following config in the static:

Code: Select all

define serviceescalation{
		servicegroup_name		NCPA,NRPE
		first_notification      2
      last_notification       0
      notification_interval   30
		contacts	nagiosadmin
		}
and after restarting nagios, I could see ALL of the services, members of the NCPA & NRPE servicegroups in the service escalations in the objects.cache.

I believe this is a good candidate for a feature request. We should really add this functionality to the service escalations. Let me know if you want me to post an internal FR.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Hostgroups and servicegroups escalation not working

Post by eloyd »

Core. Don't care about XI. It's not working in Core 4.1.1. :)
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Hostgroups and servicegroups escalation not working

Post by lmiltchev »

If you set up a service escalation as such:

Code: Select all

define serviceescalation{
servicegroup_name Ports
first_notification 2
last_notification 0
notification_interval 30
contacts eloyd
}
and restart nagios, do you see all members of the "Ports" service group (host,service pair) in the service escalations in the objects.cache?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Hostgroups and servicegroups escalation not working

Post by eloyd »

Yes, that works, and creates escalations for all services in the port groups on all hosts that they run on. But that's not what I want. I want to be able to specify the hostgroup_name as well, to limit the escalations to those in the "public" host group. It is this combination of hostgroup_name and servicegroup_name that fails. And Nagios provides no error condition as to why it fails on the configuration verify:

Code: Select all

define serviceescalation{
        hostgroup_name public
        servicegroup_name Ports
        first_notification 2
        last_notification 0
        notification_interval 30
        contacts eloyd


# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.

#
Last edited by eloyd on Wed Sep 21, 2016 2:22 pm, edited 1 time in total.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
jfrickson

Re: Hostgroups and servicegroups escalation not working

Post by jfrickson »

Post a bug report on github for verify not flagging that as a problem.

If you want you can also post a feature request to allow specifying both.

The bug I could get to fairly soon, the FR would take longer.
welldynesystems
Posts: 3
Joined: Mon Nov 16, 2015 11:42 am

Re: Hostgroups and servicegroups escalation not working

Post by welldynesystems »

We are also looking for service group based escalation to be added to the interface. Was this ever submitted?
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Hostgroups and servicegroups escalation not working

Post by eloyd »

I can't remember. But I did find this: https://github.com/NagiosEnterprises/na ... /issues/65
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
Locked