Introducing two(2) oncall teams into nagios configuration

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
andreas.marschke
Posts: 2
Joined: Mon Jan 19, 2015 4:44 am

Introducing two(2) oncall teams into nagios configuration

Post by andreas.marschke »

Hi!

I'm using Nagios at work and have sanitized a previously scattered configuration and implemented most of it with best practices and practicallity in mind.

Previously we've had a single oncall contact_group who would be asked to take care of Notifications
coming from the systems. To rotate we also have developers do their part throughout the year and everybody is oncall atleast once for a week.

However, since we introduced a new product and subsequently a new set of servers it became necessairy to split oncall between the 2 products.

I still have serveraly services that are attaced to hostgroups and through those with hosts. But they all point to the same contact_group "oncall".

Is there a painless possibillity to split contacts for services depending on the host they are checked on?

Ie: You have OncallA and OncallB both have several hosts such as server-a-1, server-b-1 and both share common services and service checks "Memory Usage", "Disk Usage". What I now want is, should "Disk Usage" raise a critical on server-a-1 the notification is supposed to go to OncallA and not OncallB and vice versa for Notifications on server-b-1.

I've been thinking of setting a custom macro variable a'la _CONTACTS in the hosts additionally to their host-template that already describes their membership to one of each group. But then setting services contact_groups $_HOSTCONTACTS$ throws this:

Code: Select all

Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Running pre-flight check on configuration data...

Checking services...
Error: Contact group '$_HOSTCONTACTS$' specified in service 'Physical Disk Status' for host 'server-a-1' is not defined anywhere!
        Checked 2815 services.
Checking hosts...
        Checked 186 hosts.
Checking host groups...
        Checked 61 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 17 contacts.
Checking contact groups...
        Checked 8 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 0 host dependencies.
Checking commands...
        Checked 44 commands.
Checking time periods...
        Checked 3 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   1

***> One or more problems was encountered while running the pre-flight check...

     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.
Any suggestions on what to do with this?

Thanks in advance!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Introducing two(2) oncall teams into nagios configuratio

Post by tmcdonald »

If you do not set any contact options for a particular service, it will be inherited from the host.
Former Nagios employee
andreas.marschke
Posts: 2
Joined: Mon Jan 19, 2015 4:44 am

Re: Introducing two(2) oncall teams into nagios configuratio

Post by andreas.marschke »

Hi!

What part of the documentation describes it like that?

What version of Nagios Core (free Nagios) supports this behaviour?


Thanks in advance,

Andreas.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Introducing two(2) oncall teams into nagios configuratio

Post by eloyd »

Yah, good point. I've been doing this for over 10 years now and never knew that!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Introducing two(2) oncall teams into nagios configuratio

Post by tmcdonald »

At least since v3.5, maybe as far back as v3.0:

http://nagios.sourceforge.net/docs/3_0/ ... nheritance
Former Nagios employee
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Introducing two(2) oncall teams into nagios configuratio

Post by eloyd »

I think it would read better if that information were included and/or referenced in the section on notifications.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Introducing two(2) oncall teams into nagios configuratio

Post by slansing »

Agree'd we can definitely make a note of that, or at least link back.
Locked