Not able to receive emails from alert manager

44 views
Skip to first unread message

Ali Shiekh

unread,
Jun 30, 2020, 5:22:33 PM6/30/20
to Prometheus Users
Hi guys,

i want to configure my alertmanager to send alerts on emails.
i have a rule set for instance if it goes down, an alert is activated.

Although i'm able to check alerts on Web UI
1.JPG

But i'm not able to receive any emails.

Here is my alertmanager.yml file:

global:

route:
  group_by: [Alertname]
  receiver: email-me

receivers:
  - name: email-me
    email_configs:
    - to: 'xx...@gmail.com'
      from: 'xx...@gmail.com'
      smarthost: 'smtp.gmail.com:587'
      auth_username: "xx...@gmail.com"
      auth_password: "xxxxxx"


And I've also checked alertmanager logs and it gives me this:

Jun 30 17:17:17 localhost.localdomain alertmanager[41098]: level=error ts=2020-06-30T21:17:17.150686531Z caller=notify.go:332 component==dispatcher msg="Error on notify" err="Post http://127.0.0.1:5001/: dial tcp 127.0.0.1:5001: connect: connection refused"
Jun 30 17:17:17 localhost.localdomain alertmanager[41098]: level=error ts=2020-06-30T21:17:17.150754532Z caller=dispatch.go:177 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="Post http://127.0.0.1:5001/: dial tcp 127.0.0.1:5001: connect: connection refused"

I've searched a lot online, couldn't find anything!
Can someone please help me with this, Thanks in advance!



Brian Candler

unread,
Jul 1, 2020, 3:23:48 AM7/1/20
to Prometheus Users
You're not showing us the actual alertmanager.yml config you're using.

Port 5001 comes from one of the example configs for an alertmanager webhook:

./examples/webhook/echo.go:     log.Fatal(http.ListenAndServe(":5001", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
./examples/ha/alertmanager.yml:  - url: 'http://127.0.0.1:5001/'

Message has been deleted

Ali Shiekh

unread,
Jul 1, 2020, 9:41:43 AM7/1/20
to Prometheus Users
Here's my alertmanager.yml file:

2.JPG



And it contains the same config i attached above.
Please assist me over this, i'm new to prometheus.
Thanks.

Brian Candler

unread,
Jul 1, 2020, 12:01:12 PM7/1/20
to Prometheus Users
Well, all I can say for definite is that you're not running with the config file that you think you are.  You're running alertmanager with a config that has a webhook receiver pointing to port 5001.

Check how you're starting alertmanager.  Check what config file you're pointing it to on the command line.  Check you restarted it after editing the config (actually, "killall -HUP alertmanager" is all you need).  Check the logs after restarting it.  Check you're looking on the right server.
Reply all
Reply to author
Forward
0 new messages