My nagios.cfg has enable_notifications set to 1. Under servers/example.com.cfg, I have this:
Code: Select all
define host{
use linux-server
host_name example.com
}
define service {
use generic-service
host_name example.com
service_description PING
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 1
check_command check_ping!100.0,20%!500.0,60%
}
define service {
use generic-service
host_name example.com
service_description SSH
check_command check_ssh
}
define service {
use generic-service
host_name example.com
service_description HTTP
check_command check_http
}Code: Select all
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" >> /var/nagios/notify.log
}
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" >> /var/nagios/notify.log
}Notably, I'm just trying get some relevant logging information sent to notify.log. I will stop nagios, copy out example.com.cfg and start nagios (to clear the 'server' from nagios), the stop nagios, copy example.com.cfg back in to the servers directory, and start nagios. The web interface shows that a check on example.com is pending, then shows that the check came back that example.com is down, but nothing is written into /var/nagios/notify.log. The nagios process is using nagios:nagios, and /var/nagios/notify.log is set to nagios:nagios. I haven't seen anything in the nagios.log that's relevant to why this is happening, and I've set nagios.debug to -1 and debug_verbosity to 2, and still am not seeing anything relevant.
Can anyone help me out here? What am I missing?