sSMTP : Cannot open smtp.gmail.com:587

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

sSMTP : Cannot open smtp.gmail.com:587

Postby W.W. » Wed May 17, 2017 8:13 am

Hi,

I try to set up ssmtp to send the notificatins of nagios by email but I have the below error

Code: Select all
May 17 14:43:10 VM004 sSMTP[31783]: Unable to connect to "smtp.gmail.com" port 587.
May 17 14:43:10 VM004 sSMTP[31783]: Cannot open smtp.gmail.com:587


ssmtp.conf

Code: Select all
# Your email address
root=SSSS@gmail.com

# Your Username | your password
AuthUser=SSSS@gmail.com
AuthPass=MyPassWord
AuthMethod=LOGIN

# Address and port number to send mail to
mailhub=smtp.gmail.com:587

# So the message appears to come from FAI | Hostname
#RewriteDomain=
#Hostname=
FromLineOverride=YES

# TLS | SSL/TLS Certificate
UseTLS=YES
UseSTARTTLS=YES
#UseTLSCert=YES

# RSA certificate.
#TLSCert=/etc/pki/tls/private/ssmtp.pem
#TLSCert=/etc/pki/tls/certs/ca-bundle.crt


revaliases
Code: Select all
root:SSSS@gmail.com:smtp.gmail.com:587
nagios:SSSS@gmail.com:smtp.gmail.com:587


commands.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/sbin/sendmail.ssmtp -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
   }
#/usr/sbin/sendmail.postfix sudo -s

# '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 $NOTIFICATIONCOMMENT$\n" | /usr/sbin/sendmail.ssmtp -s  "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}


I have a centos 6.9 who run nagios core 4.1
thanks
W.W.
 
Posts: 12
Joined: Wed Apr 05, 2017 3:18 am

Re: sSMTP : Cannot open smtp.gmail.com:587

Postby dwhitfield » Wed May 17, 2017 9:47 am

This is not really a Nagios issue. You'll likely get a quicker resolution on the CentOS forums.

That said, https://www.digitalocean.com/community/ ... mtp-server suggests you are using the wrong port #.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
dwhitfield
The Doctor
 
Posts: 2813
Joined: Wed Sep 21, 2016 10:29 am
Location: Nagios Enterprises, LLC


Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot], luizgomes, Yahoo [Bot] and 18 guests