Email notification
Posted: Wed Apr 12, 2017 12:36 am
Hi ! Configure nagios and postfix to send email and nothing work.
nagios command.cfg:
postfix configure like this http://www.telnetport25.com/2012/02/con ... gios-core/ and relay https://www.freelock.com/kb/postfix-relayhost
Send custom messega from web of nagios and its dont delivered.
in /var/log/nagios/ :
postfix log is empy
nagios command.cfg:
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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
#'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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Send custom messega from web of nagios and its dont delivered.
in /var/log/nagios/ :
Code: Select all
[1491974038] Successfully launched command file worker with pid 27238
[1491974062] EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;server1;0;Nagios Admin;test