Notification e-mail not sending to all contactgroup members
Posted: Wed Mar 18, 2015 4:27 pm
Hey Guys,
Working on fixing our Nagios 3.4.1 alerts. Currently, when a host/service critical alert happens, only the first user in our contact group is sent an e-mail. Seeing if you guys can assist with this. I've attached the relevant information for a specific e-mail notification for hostA that *userA* got yesterday but userB and C (which includes me) didn't get.
From contactgroups.cfg:
define contactgroup {
contactgroup_name Email - Group IT Support
alias IT Support Group
members userA, userB, userC
}
From host.cfg:
define host {
host_name hostA
check_command check-host-alive
max_check_attempts 5
check_interval 10
passive_checks_enabled 1
check_period 24x7
obsess_over_host 1
check_freshness 1
freshness_threshold 0
active_checks_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 5
notification_period 24x7
notifications_enabled 1
failure_prediction_enabled 1
alias hostAliasA
display_name
address 192.168.8.13
notification_options d,u,r,f
stalking_options o,d
contact_groups Pagers,Email - Group IT Support
hostgroups hostGroupA
}
From contacts.cfg (all 3 are set up the same way)
define contact {
contact_name userA
alias userAliasA
email userAEmail
pager
host_notifications_enabled 0
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
can_submit_commands 0
retain_status_information 0
retain_nonstatus_information 0
service_notification_options w,c,r
host_notification_commands alert-by-email
service_notification_commands alert-by-email
}
From commands.cfg
define command {
command_name alert-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.9 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\n\nFollow-up Response:\n\n1) Briefly define Root cause\n2) Impact to IT services (as felt by our customer)\n3) Remedy to fix (Immediate/short term)\n4) Remedy to prevent a recurrence (future/long term)\n\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
We use sendmail and I am able to email myself (userC) and userB from the command line correctly. Let me know if you need more information.
Working on fixing our Nagios 3.4.1 alerts. Currently, when a host/service critical alert happens, only the first user in our contact group is sent an e-mail. Seeing if you guys can assist with this. I've attached the relevant information for a specific e-mail notification for hostA that *userA* got yesterday but userB and C (which includes me) didn't get.
From contactgroups.cfg:
define contactgroup {
contactgroup_name Email - Group IT Support
alias IT Support Group
members userA, userB, userC
}
From host.cfg:
define host {
host_name hostA
check_command check-host-alive
max_check_attempts 5
check_interval 10
passive_checks_enabled 1
check_period 24x7
obsess_over_host 1
check_freshness 1
freshness_threshold 0
active_checks_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 5
notification_period 24x7
notifications_enabled 1
failure_prediction_enabled 1
alias hostAliasA
display_name
address 192.168.8.13
notification_options d,u,r,f
stalking_options o,d
contact_groups Pagers,Email - Group IT Support
hostgroups hostGroupA
}
From contacts.cfg (all 3 are set up the same way)
define contact {
contact_name userA
alias userAliasA
email userAEmail
pager
host_notifications_enabled 0
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
can_submit_commands 0
retain_status_information 0
retain_nonstatus_information 0
service_notification_options w,c,r
host_notification_commands alert-by-email
service_notification_commands alert-by-email
}
From commands.cfg
define command {
command_name alert-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.9 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\n\nFollow-up Response:\n\n1) Briefly define Root cause\n2) Impact to IT services (as felt by our customer)\n3) Remedy to fix (Immediate/short term)\n4) Remedy to prevent a recurrence (future/long term)\n\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
We use sendmail and I am able to email myself (userC) and userB from the command line correctly. Let me know if you need more information.