Emails wont stop


#1

Hm, now a new problem with my e-mail notifications. I decided to mess around with epager notifications in 2.0b4, so I turned off e-mail notifications in my cfg files and turned on the epager notifications to see if I could get notifications sent to my cell phone. I restarted Nagios and disconnected one of the servers I was monitoring, and I still got e-mail notifications. Here are my configs. Notice anything wrong about them?

#Contacts.cfg
define contact{
contact_name nagios-admin
alias admin
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-epager
host_notification_commands host-notify-by-epager
email me@mycompany.com
pager XXXXXXXXXX
}
define contact{
contact_name sys-admin
alias myles
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-epager
host_notification_commands host-notify-by-epager
pager XXXXXXXXXX

#Contactgroups.cfg
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members nagios-admin,sys-admin
}

#Hosts.cfg
define host{
use generic-host
host_name server
register 1
alias XXXXXX-server
address server.mycompany.com
check_command check-host-alive
max_check_attempts 10
notification_interval 0
notification_period 24x7
notification_options d,u,r
contact_groups admins
}

#misccommands.cfg

‘notify-by-email’ command definition

define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nS
tate: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$” | /bin/mail -s “**Nagios-02 - $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $S
ERVICESTATE$ **” $CONTACTEMAIL$
}

‘notify-by-epager’ command definition

define command{
command_name notify-by-epager
command_line /usr/bin/printf “%b” “Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$
” | /bin/mail -s “$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$” $CONTACTPAGER$
}

‘host-notify-by-email’ command definition

define command{
command_name host-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $H
OSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /bin/mail -s “Nagios-02 - Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$
}

‘host-notify-by-epager’ command definition

define command{
command_name host-notify-by-epager
command_line /usr/bin/printf “%b” “Host ‘$HOSTALIAS$’ is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$” | /bin/mail -s “$NOTIFICATIONTYPE$ alert - Host $HOSTNA
ME$ is $HOSTSTATE$” $CONTACTPAGER$
}

Is there some other file that I’m forgetting that might be sending these notifications to my email? Mayhap it’d be better to go back to an earlier release of Nagios. We have a server that’s running an earlier Beta release that runs perfectly well.
Edited ]


#2

nagios.sourceforge.net/docs/2_0/ … tion_notes
The above url explains why you need to disable/enable notifications via the cgi webpages for all services that you want this to take affect on.