Page 1 of 1

The problem send mail in Nagios 3.5.1

Posted: Thu Mar 10, 2016 7:37 am
by rumarcin11
Do not send me the subject, but I have a blank subject.
what to eat and why no
Possibly that is why esmtp, but changed to mail -s "qqq" it does not send me e-mail, but the console echo "qq" | mail -s "qqq" <my mail> then sends
# '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/esmtp -C /etc/esmtprc $CONTACTEMAIL$ -X /tmp/esmtp.log
}


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$LONGSERVICEOUTPUT$" | /usr/bin/esmtp -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ -X /var/log/nagios3/esmtp.log

Re: The problem send mail in Nagios 3.5.1

Posted: Thu Mar 10, 2016 10:54 am
by rkennedy
ESMTP may be operating different then postfix, can you send an email using ESMTP over the CLI as a test, and post the full input/output?

Re: The problem send mail in Nagios 3.5.1

Posted: Fri Mar 11, 2016 2:59 am
by rumarcin11
It runs the ssmtp, that is, sending my | mail -s .....

Re: The problem send mail in Nagios 3.5.1

Posted: Fri Mar 11, 2016 11:13 am
by hsmith
Did you use any sort of guide to set this up? esmtp is not something we use by default.

Re: The problem send mail in Nagios 3.5.1

Posted: Wed Mar 16, 2016 5:25 am
by rumarcin11
Already working as it should. With mailx because esmtp not work

Re: The problem send mail in Nagios 3.5.1

Posted: Wed Mar 16, 2016 11:33 am
by rkennedy
Got it, are we good to mark this thread as resolved then since mailx is working for you?

Re: The problem send mail in Nagios 3.5.1

Posted: Fri Mar 18, 2016 4:01 am
by rumarcin11
running mailx

Re: The problem send mail in Nagios 3.5.1

Posted: Fri Mar 18, 2016 1:54 pm
by rkennedy
Can you please clarify, is mailx working for you?