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.
Thanks in advance!