Re: using contacts causing double email alert
Posted: Mon Sep 08, 2014 2:50 pm
You will want to do that for any template.
The service definitions for generic-service, generic-service-dba, generic-service-mesproject, generic-service-cim all should likely have 'register 0' (I don't know that I see all those in use in the configs provided, but since they are intended to be templates with only partial configs that are for inclusion in other definitions, register 0 is appropriate).
The example you provided of double notification was for '6800SRETDB', which I don't see in that config.zip - I do see it in a hostgroup, just no host definition - I'll assume it is the same as the 6800SHDB and 6800SHDB-DR hosts' H drive check which you did include:
So that service definition includes the generic-service-dba template found in your generic-service_nagios2.cfg file:
Here is the contactgroup from your config that this template is using:
So, if you don't define a contacts or contact_groups in the H drive service definition, the template alone will notify the itdba address because of the inclusion of the db-admins contactgroup in the generic-service-dba service template. If you add a
To the original H drive check like this:
You would then have both a contacts and a contact_groups defined for that H Drive service check due to the inheritance of the generic-service-dba service template. Defining contacts here does not override the inclusion of the contact_groups in the template. If you place a new contact_groups in the H drive service definition it *will* override the service templates setting. If you want to cancel the inheritance of a value from one of the chained templates, you would use 'null' along with the value:
See Cancelling Inheritance of String Values on the object inheritance page.
The service definitions for generic-service, generic-service-dba, generic-service-mesproject, generic-service-cim all should likely have 'register 0' (I don't know that I see all those in use in the configs provided, but since they are intended to be templates with only partial configs that are for inclusion in other definitions, register 0 is appropriate).
The example you provided of double notification was for '6800SRETDB', which I don't see in that config.zip - I do see it in a hostgroup, just no host definition - I'll assume it is the same as the 6800SHDB and 6800SHDB-DR hosts' H drive check which you did include:
Code: Select all
define service{
use generic-service-dba
host_name 6800SHDB,6800SHDB-DR
service_description H Drive
check_command check_snmp_disk!public!H!70%!80%
}
Code: Select all
define service{
name generic-service-dba
use generic-service-template
#contacts itdba
contact_groups db-admins
register 0 #added since this is a template
}
Code: Select all
define contactgroup{
contactgroup_name db-admins
alias DB Admins
members itdba
}
Code: Select all
contacts root
Code: Select all
define service{
use generic-service-dba
host_name 6800SHDB,6800SHDB-DR
service_description H Drive
check_command check_snmp_disk!public!H!70%!80%
contacts root
}
Code: Select all
define service{
use generic-service-dba
host_name 6800SHDB,6800SHDB-DR
service_description H Drive
check_command check_snmp_disk!public!H!70%!80%
contacts root
contact_groups null
}