Nagios sending service notifications incorrectly
Posted: Tue Jan 21, 2014 7:15 pm
Hello,
I am new to Nagios and I am having a bizarre problem.
I want a service event to be ONLY sent to an email address listed in my service description,maxtor_plus:
I was so happy. I thought that the service definitions in the contact definition were overiding the service description contact groups. When I tried to send omit the service settings in the contact groups, nagios complaned since they were required settings. So given my definitions, how can I get a service failure to send an email only to maxtor_plus and not dexter_plus?
I am new to Nagios and I am having a bizarre problem.
I want a service event to be ONLY sent to an email address listed in my service description,maxtor_plus:
However, for some reason I have been unable to figure out, whenever there is a service event a notification also gets sent to a contact listed under the host definition, dexter_plus:define service{
name local-service-maxtor ; The name of this service template
use generic-service ; Inherit default values from the generic-service definition
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 4 ; Re-check the service up to 4 times in order to determine its final (hard) state
normal_check_interval 5 ; Check the service every 5 minutes under normal conditions
retry_check_interval 1 ; Re-check the service every minute until a hard state can be determined
contacts maxtor_plus ; Notifications get sent out to everyone in the 'admins'and 'support' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recovery events
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
define host{
name server1 ; The name of this host template
use generic-host ; This template inherits other values from the generic-host template
check_period 24x7 ; By default, Linux hosts are checked round the clock
max_check_attempts 10 ; Check each Linux host 10 times (max)
check_command check-host-alive ; Default command to check Linux hosts
notification_period 24x7 ; Linux admins hate to be woken up, so we only notify during the day
; Note that the notification_period variable is being overridden from
; the value that is inherited from the generic-host template!
notification_interval 120 ; Resend notification every 2 hours
notification_options d,u,r ; Only send notifications for specific host states
contacts dexter_plus, maxtor_plus
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
When I change the service_notification_options in the contact definition to w,r and I deactivate a service on a server in question, the critical emails do not get sent to dexter_plus!
define contact{
contact_name dexter_plus
alias d_support
service_notification_period 24x7
host_notification_period 24x7
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email {a valid email address omitted}
}
I was so happy. I thought that the service definitions in the contact definition were overiding the service description contact groups. When I tried to send omit the service settings in the contact groups, nagios complaned since they were required settings. So given my definitions, how can I get a service failure to send an email only to maxtor_plus and not dexter_plus?