Thursday, November 13, 2014

nagios (Last Notification: N/A (notification 0))



I can't figure out but for some reason Nagios doesn't send me an alert on some of the services that I monitor, I was wondering if someone can help me out a bit.



this is service




define service {
hostgroup_name nrpe-disk

service_description disk
use alarm,check
check_command check_nrpe1!check_disk
register 1
}


here is my command





define command {
command_name check_nrpe1
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}


here is service template




define service {

name alarm
notification_interval 0
notification_period 247
notification_options w,u,r,c,f,s
notifications_enabled 1
contact_groups staff
register 0

}




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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}

define command {
command_name notify-host-by-pager
command_line /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$" | /usr/bin/mail $CONTACTPAGER$

}

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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

define command {
command_name notify-service-by-pager
command_line /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail $CONTACTPAGER$

}



define contactgroup {
contactgroup_name staff
alias XXXXXXXX
members XXXXXXXX XXXXXXXX
}




define contact {
contact_name XXXXXXX XXXXXX
alias XXXXXXXXX
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 247
service_notification_period 247
host_notification_options d,u,r,f,s

service_notification_options w,u,c,r,f,s
host_notification_commands notify-host-by-email,notify-host-by-pager
service_notification_commands notify-service-by-email,notify-service-by-pager
email XXXXXXXXX@XXXXXXXX.XXX
pager XXXXXXXXXX@messaging.sprintpcs.com
}

Answer



I don't see it mentioned in your question or any of the answers but have you checked the nagios.cfg file for the enable_notifications setting? Is it set to 0 or 1?




Also is this only happening on a given service notification or is it affecting all notifications? If it's all I would suspect that enable_notifications is set to 0 in the nagios.cfg file. If so try changing it to 1 and restarting Nagios.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...