SMTP authentication

432 views
Skip to first unread message

dougm...@precocityllc.com

unread,
Feb 25, 2016, 8:09:24 AM2/25/16
to Prometheus Developers
Hi there,

I'm trying to get alertmanager set up for the first time, and I can't seem to find documentation on howto tell Alertmanager how to authenticate to my SMTP host. (like, how do I provide a password?) Can anyone point me in the right direction?

much appreciated

Julius Volz

unread,
Feb 25, 2016, 9:25:07 AM2/25/16
to dougm...@precocityllc.com, Prometheus Developers
The documentation for the new AM doesn't document this yet, but you can see the used environment vars in the source here, depending on the type of auth you're using: https://github.com/prometheus/alertmanager/blob/master/notify/impl.go#L223-L256


--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maxim Filatov

unread,
Feb 25, 2016, 9:28:02 AM2/25/16
to Prometheus Developers
BTW, about mail: is there any chance to use plain sendmail instead of SMTP?
Thanks in advance.


Best regards, 
Maxim Filatov

Brian Brazil

unread,
Feb 25, 2016, 9:37:52 AM2/25/16
to Maxim Filatov, Prometheus Developers
On 25 February 2016 at 14:27, Maxim Filatov <pipo...@gmail.com> wrote:
BTW, about mail: is there any chance to use plain sendmail instead of SMTP?
Thanks in advance.

I don't think that's something we're likely to add. Doing a fork+exec on every email could be quite a bit of load, when SMTP already covers the main use case. If you'd like to do something custom, there's always the webhhok.

Brian



--

Maxim Filatov

unread,
Feb 25, 2016, 10:00:37 AM2/25/16
to Prometheus Developers
I don't think that's something we're likely to add. Doing a fork+exec on every email could be quite a bit of load, when SMTP already covers the main use case. If you'd like to do something custom, there's always the webhhok.

Brian



OK, pretty clear.

Thank you.

Best regards, 
Maxim Filatov


Doug McCluer

unread,
Feb 25, 2016, 2:48:56 PM2/25/16
to Julius Volz, Prometheus Developers
Forgive me, I'm not a go guy so I'm having trouble following that code.  Surely you're not telling me I have to set an environment variable containing my email password, right?
--

Doug McCluer | Precocity, LLC Tel/Direct: (972) 378-1030 | Mobile: (214) 810-3844 DougM...@precocityllc.com | www.precocityllc.com


__
__

Julius Volz

unread,
Feb 25, 2016, 6:07:00 PM2/25/16
to Doug McCluer, Prometheus Developers
So it means, as per my reading of the code:

Provide the username as env variable SMTP_AUTH_USERNAME.

If you're using CRAM-MD5 auth: provide the SMTP_AUTH_SECRET env var.

If you're using PLAIN auth: provide both the SMTP_AUTH_PASSWORD and SMTP_AUTH_IDENTITY env vars.

As far as I can see, the code just chooses the first auth method that the server returns.

Doug McCluer

unread,
Feb 25, 2016, 6:52:30 PM2/25/16
to Julius Volz, Prometheus Developers
I see.  Thanks for the clarification :)

I wasn't expecting environment variables to used to pass in the from address & password.  But then, I don't have a lot of experience in this area. Could you educate me as to the reasons for using environment variables rather than storing that in the yml config file?

The format of the config file seems to suggest that you would be able to define different "from" emails for different receivers, but I'm not sure how that would work if there's only one environment variable for password. 

Also, does the alertmanager emailer use TLS?  I'm getting the following error from Gmail "530 5.7.0 Must issue a STARTTLS command first.".


mpcha...@gmail.com

unread,
Apr 19, 2016, 10:34:21 PM4/19/16
to Prometheus Developers, dougm...@precocityllc.com

For posterity, smtp authentication parameters have been moved from environment variables to the YAML config in master now https://github.com/prometheus/alertmanager/pull/308

Reply all
Reply to author
Forward
0 new messages