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
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
Code: Select all
root:SSSS@gmail.com:smtp.gmail.com:587
nagios:SSSS@gmail.com:smtp.gmail.com:587
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$
}
thanks