Email notifications problem


#1

Hi all.
I have a problem with notifications by email. I use version 3.0.2.
Part of my config:
templates.cfg
define service {
name generic-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 0
failure_prediction_enabled 1
process_perf_data 1
register 0
is_volatile 0
check_period 24x7
max_check_attempts 10
check_interval 3
retry_check_interval 3
notification_interval 30
notification_period 24x7
notification_options w,u,c,r
}
hosts.cfg
define service {
use generic-service
host_name hostname.domain.com
service_description load
display_name Load local
contact_groups admins
check_command check_local_load!0.60,0.60,0.60!0.80,0.80,0.80
}
notify.cfg
define command{
command_name host-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios niitp \n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/nail -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$
}
define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” "
Nagios niitp ***\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/nail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

When service state is critical or warning or unknown or recoveries i don’t receive any notifications.
But, when “Send custom service notification” from web interface, i receive normal email.
Please, help me.
Thank you.


#2

in the command-definitions I see: “nail”, shouldn’t that be “mail”?


#3

thank for you reply, but nail is mail client
heirloom.sourceforge.net/mailx.html
I am repeat:
when “Send custom service notification” from web interface, i receive normal email.


#4

Problem solved. I am not used nagiosadmin (plugin for nagios), wrote configuration by hands and everything worked.