Can't get ssmtp to gmail working for notifications

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
simplifyandaddcoffee
Posts: 2
Joined: Mon Feb 15, 2021 8:08 am

Can't get ssmtp to gmail working for notifications

Post by simplifyandaddcoffee »

I've been trying to configure ssmtp to gmail working. It's been one thing after another for the last 6 hours and I'm just completely lost and just copy pasting commands at this point.

Here's the chunk of the commands.conf

Code: Select all

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/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n"

}


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$" | /usr/bin/sendEmail -s $USER7$ -xu $USER9$ -xp $USER10$ -t $CONTACTEMAIL$ -f $USER5$ -l /var/log/sendEmail -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -m "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$"

}
and here's what I'm currently getting:

Code: Select all

[02-15-2021 12:59:24] wproc: stdout line 02: Feb 15 12:59:24 sparq sendEmail[15026]: ERROR => Received: ┺ 5.7.0 Must issue a STARTTLS command first. ########.47 - gsmtp
[02-15-2021 12:59:24] wproc: stdout line 01: Feb 15 12:59:24 sparq sendEmail[15026]: NOTICE => Authentication not supported by the remote SMTP server!
[02-15-2021 12:59:24] wproc: stderr line 02: print() on closed filehandle LOGFILE at /usr/bin/sendEmail line 1160, <GEN0> line 9.
[02-15-2021 12:59:24] wproc: stderr line 01: NOTICE: The log file [/var/log/sendEmail] does not exist. Creating it now with mode [0600].
[02-15-2021 12:59:24] wproc: early_timeout=0; exited_ok=1; wait_status=256; error_code=0;
[02-15-2021 12:59:24] wproc: host=blue.home.arpa; service=(none); contact=nagiosadmin
[02-15-2021 12:59:24] wproc: NOTIFY job 0 from worker Core Worker 15007 is a non-check helper but exited with return code 1
[02-15-2021 12:59:24] HOST NOTIFICATION: nagiosadmin;blue.home.arpa;CUSTOM (UP);notify-host-by-email;PING OK - Packet loss = 0%, RTA = 1.83 ms;Nagios Admin;test2
simplifyandaddcoffee
Posts: 2
Joined: Mon Feb 15, 2021 8:08 am

Re: Can't get ssmtp to gmail working for notifications

Post by simplifyandaddcoffee »

bump, still would like to have working email alerts....
mocosoft
Posts: 2
Joined: Sat Feb 27, 2021 4:01 am
Contact:

Re: Can't get ssmtp to gmail working for notifications

Post by mocosoft »

Hi

i have the same problem... no login password and still get the same error...

i tried running as admin, or running directly from the Schedule button, always the same results...

thanks a lot for your support.

Robbie
Locked