Regarding the notifications
Posted: Fri Apr 18, 2014 6:43 am
Hi All,
I have created the notification contact named testuser and made this as notification contact for one service. Even the service state is changed, the testuser us not receiving any notifiactions,
please be informed that from the server command line I could send the email to the same user and I can observer that the state is changed in nagios.log file
[1397822095] SERVICE ALERT: oracle;CRITICAL;SOFT;1;the oracle process is not running on the server
This is the contacts.cfg file content
define contact {
contact_name testuser
alias User for testing purpose
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s,n,
service_notification_options w,u,c,r,f,s,n,
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
can_submit_commands 1
email emailid
}
I have changed the host_notification and service_notification commands to notify-host-by-email and notify_service_by_email.
The command definition for notify-service-by-email is below
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: http://nagios/nagios/cgi-bin/status.cgi ... l\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Still the issue is not getting resolved.
one more question in the nagios.log file I am observing two states service alert and service notification. what is the difference between them
I have created the notification contact named testuser and made this as notification contact for one service. Even the service state is changed, the testuser us not receiving any notifiactions,
please be informed that from the server command line I could send the email to the same user and I can observer that the state is changed in nagios.log file
[1397822095] SERVICE ALERT: oracle;CRITICAL;SOFT;1;the oracle process is not running on the server
This is the contacts.cfg file content
define contact {
contact_name testuser
alias User for testing purpose
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,f,s,n,
service_notification_options w,u,c,r,f,s,n,
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
can_submit_commands 1
email emailid
}
I have changed the host_notification and service_notification commands to notify-host-by-email and notify_service_by_email.
The command definition for notify-service-by-email is below
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: http://nagios/nagios/cgi-bin/status.cgi ... l\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Still the issue is not getting resolved.
one more question in the nagios.log file I am observing two states service alert and service notification. what is the difference between them