Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Nessero
Posts: 10 Joined: Wed Apr 12, 2017 12:18 am
Post
by Nessero » Wed Apr 12, 2017 12:36 am
Hi ! Configure nagios and postfix to send email and nothing work.
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$
}
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/ :
Code: Select all
[1491974038] Successfully launched command file worker with pid 27238
[1491974062] EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;server1;0;Nagios Admin;test
postfix log is empy
mcapra
Posts: 3739 Joined: Thu May 05, 2016 3:54 pm
Post
by mcapra » Wed Apr 12, 2017 10:51 am
Did you follow a particular guide for the Nagios end of things when setting this up?
Does your contact have the proper host_notification_commands and service_notification_commands set?
Can you share the output of which mail ? The default Linux MTA doesn't typically recognize Postfix unless you tell it to.
Nessero
Posts: 10 Joined: Wed Apr 12, 2017 12:18 am
Post
by Nessero » Wed Apr 12, 2017 10:25 pm
mcapra wrote: Did you follow a particular guide for the Nagios end of things when setting this up?
Does your contact have the proper host_notification_commands and service_notification_commands set?
Can you share the output of which mail ? The default Linux MTA doesn't typically recognize Postfix unless you tell it to.
Yep i don't set notification commands in contact.cfg. Anover question. Where configure how often notifications sent to mail ?
dwhitfield
Former Nagios Staff
Posts: 4583 Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:
Post
by dwhitfield » Fri Apr 14, 2017 7:55 am
Did you have any more questions or are we ready to close? Thanks!
Nessero
Posts: 10 Joined: Wed Apr 12, 2017 12:18 am
Post
by Nessero » Tue Apr 18, 2017 11:16 pm
dwhitfield wrote: Did you have any more questions or are we ready to close? Thanks!
Ready to close. Thanks!