Untraceable service by-email notification


Hi all,

I have defined a custom service notification command that I am using to send alerts to CA Spectrum. That part is working, but for every alert I send, I am also getting a corresponding service notification by email to the nagiosadmins contact group despite my service having an inherited contacts statement. I have spent hours trying to track this down and just can’t resolve it. Can anyone tell me why the notify-service-by-email command is being called at all? Thanks.

  • Kyle

Here is the service.

define service{
use spectrum-sbgw-service
host_name bt-lin-datactr3
max_check_attempts 1
service_description check-sbgw-test
check_command check_sbgw

Here is the service template and contact.

define service{
name spectrum-sbgw-service ; Spectrum Southbound Gateway
contacts spectrum-sbgw
check_period 24x7
max_check_attempts 3
normal_check_interval 10
retry_check_interval 1
register 1

define contact{
contact_name spectrum-sbgw
service_notification_commands notify-service-by-spectrum
service_notification_options w,u,c,r,f,s
service_notification_period 24x7
host_notification_commands notify-host-by-email
host_notification_options d,u,r,f,s
host_notification_period 24x7
register 1

The command.

‘notify-service-by-spectrum’ command definition

define command{
command_name notify-service-by-spectrum
command_line /usr/bin/sudo -u spectrum /usr/local/scripts/spectrum-sbgw $HOSTNAME$ $HOSTADDRESS$ $SERVICEDESC$ $SERVICESTATE$ “$SERVICEOUTPUT$”

And here is the action logged.

Mon Apr 20 10:52:31 2009 SERVICE ALERT: bt-lin-datactr3;check-sbgw-test;CRITICAL;HARD;1;CRIT: Test failed with CRIT
Mon Apr 20 10:52:31 2009 SERVICE NOTIFICATION: nagiosadmin;bt-lin-datactr3;check-sbgw-test;CRITICAL;notify-service-by-email;CRIT: Test failed with CRIT
Mon Apr 20 10:52:31 2009 SERVICE NOTIFICATION: spectrum-sbgw;bt-lin-datactr3;check-sbgw-test;CRITICAL;notify-service-by-spectrum;CRIT: Test failed with CRIT


This was being caused by implied inheritance of contact_groups from the host setting.