The problem send mail in Nagios 3.5.1

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.
Locked
rumarcin11
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

The problem send mail in Nagios 3.5.1

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: The problem send mail in Nagios 3.5.1

Post 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?
Former Nagios Employee
rumarcin11
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: The problem send mail in Nagios 3.5.1

Post by rumarcin11 »

It runs the ssmtp, that is, sending my | mail -s .....
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: The problem send mail in Nagios 3.5.1

Post by hsmith »

Did you use any sort of guide to set this up? esmtp is not something we use by default.
Former Nagios Employee.
me.
rumarcin11
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: The problem send mail in Nagios 3.5.1

Post by rumarcin11 »

Already working as it should. With mailx because esmtp not work
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: The problem send mail in Nagios 3.5.1

Post by rkennedy »

Got it, are we good to mark this thread as resolved then since mailx is working for you?
Former Nagios Employee
rumarcin11
Posts: 36
Joined: Thu Feb 25, 2016 7:42 am

Re: The problem send mail in Nagios 3.5.1

Post by rumarcin11 »

running mailx
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: The problem send mail in Nagios 3.5.1

Post by rkennedy »

Can you please clarify, is mailx working for you?
Former Nagios Employee
Locked