Grafana Failed to send alert notifications

Hello,
I have been trying to “Send Test” to try out the Grafana Alerting however I did not manage to make it work…

I followed the official documentation on Grafana’s website and this tutorial : Grafana Mail Alert Configuration. | techiescorner.in .

This is my configuration on Grafana:

Then in the configuration files I have the following for the configuration of SMTP other than that I did not change anything in the file:


After this, I restarted Grafana as asked by the tutorials using the command line.

However, when I try to “Send Test” I get the following error on Grafana: “Failed to send alert notifications”

So I looked in the log and go this:

t=2020-08-07T17:43:45+0100 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[lolasmith2406@gmail.com] singleEmail=true
t=2020-08-07T17:43:46+0100 lvl=eror msg="Failed to send alert notification email" logger=alerting.notifier.email error="Failed to send notification to email addresses: lolasmith2406@gmail.com: dial tcp: lookup stmp.gmail.com on 127.0.0.1:53: no such host"
t=2020-08-07T17:43:46+0100 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Failed to send notification to email addresses: lolasmith2406@gmail.com: dial tcp: lookup stmp.gmail.com on 127.0.0.1:53: no such host"
t=2020-08-07T17:43:46+0100 lvl=eror msg="failed to send notification" logger=alerting.notifier uid= error="Failed to send notification to email addresses: lolasmith2406@gmail.com: dial tcp: lookup stmp.gmail.com on 127.0.0.1:53: no such host"
t=2020-08-07T17:43:46+0100 lvl=eror msg="Failed to send alert notifications" logger=context userId=1 orgId=1 uname=admin error="Failed to send notification to email addresses: lolasmith2406@gmail.com: dial tcp: lookup stmp.gmail.com on 127.0.0.1:53: no such host" remote_addr=[::1]
t=2020-08-07T17:43:46+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alert-notifications/test status=500 remote_addr=[::1] time_ms=437 size=48 referer=http://localhost:2000/alerting/notification/2/edit

I do not understand what my error is and what I should do to make it work. Can anyone please help me or if I need to add any additional information please let me know. Thank you

The Gmail hostname is smtp.gmail.com and not stmp

Hi @lolasm

An easy to follow article Grafana Mail Alert Configuration. | techiescorner.in

https://localhost:3000/t/grafana-failed-to-send-alert-notifications/34808

Hello
i am trying to configure the alerts in grafana smtp one
i am getting failed to send alerts
the logs are below

t=2023-02-27T10:14:32+0000 lvl=info msg=“Sending alert notification to” logger=alerting.notifier.email addresses=[username@abbott.com] singleEmail=false
t=2023-02-27T10:14:32+0000 lvl=eror msg=“Failed to send alert notification email” logger=alerting.notifier.email error=“strconv.Atoi: parsing " 25": invalid syntax”
t=2023-02-27T10:14:32+0000 lvl=eror msg=“failed to send notification” logger=alerting.notifier uid= error=“strconv.Atoi: parsing " 25": invalid syntax”
t=2023-02-27T10:14:32+0000 lvl=eror msg=“Failed to send alert notifications” logger=context userId=1 orgId=1 uname=admin error=“strconv.Atoi: parsing " 25": invalid syntax” remote_addr=10.252.149.101

can you tell what might be the issue

My guess is that you have a space between host and the port number.

There should be no space after the colon between host and port for the host configuration setting:

[smtp]
enabled = true
host = smtp.myhost.org:2525

Is anyone getting a timeout error when sending Alerts or Test Notification from Grafana? I have Prometheus and Grafana service installed in our RHEL 8 server (linux red hat) and grafana using YUM repository installation. Not using any docker images. vi This is the file path: /etc/grafana/grafana.ini

[smtp]
enabled = true
host = **:587
user = ****
password = *****
skip_verify = false
from_address = noreply@
.com
from_name = Grafana

Tried with starttls = nostarttls option also in the same file but still getting the same error ::: Can someone please help?

logger=ngalert.notifier.email t=2023-03-30T09:05:03.607196208-05:00 level=error msg=“Missing receiver”
logger=ngalert.notifier.email t=2023-03-30T09:05:03.607257464-05:00 level=error msg=“Missing group labels”
logger=alertmanager org=1 t=2023-03-30T09:05:12.375168702-05:00 level=error component=alertmanager orgID=1 component=dispatcher msg=“Notify for alerts failed” num_alerts=16 err=“Email Alerts/email[0]: notify retry canceled due to unrecoverable error after 1 attempts: failed to send notification to email addresses: sanitized@jll.com: dial tcp xx.x.xxx.x:587: i/o timeout”
logger=context userId=1 orgId=1 uname=admin t=2023-03-30T09:05:13.608405778-05:00 level=info msg=“Request Completed” method=POST path=/api/alertmanager/grafana/config/api/v1/receivers/test status=408 remote_addr=xx.xx.xx.xx time_ms=10034 duration=10.034264628s size=500 referer=“http://xx.xx.xx.xx:3000/alerting/notifications/receivers/Email%20Alerts/edit?alertmanager=grafana” handler=/api/alertmanager/grafana/config/api/v1/receivers/test
lo

1 Like