Using email alerts through Grafana

If anyone here has successfully set up an email alert (say, a high temperature alert) through the Grafana interface, using Google or other as an SMTP server, I would greatly appreciate hearing the details. I’ve used many SMTP servers over the years and so I’m pretty sure that entering my credentials correctly in grafana.ini is not a problem, and I can see that they alerts are being generated on the plots. The issue is that I’m not getting any emails and when I try to test the alert channel, I get the error message below. If this is not the appropriate forum and you know of an appropriate grafana group, please direct me because I have not yet been able to find one. I’ve scoured the forum here and found a few related posts in the beehive and pi zero threads, but nothing that has helped me, yet. Thanks much!

I ended up doing Telegram alerts as I didn’t manage to setup emails year or so ago.
Grafana has their own community forum at https://community.grafana.com/ , but this post is welcome in here too :slight_smile:

Well that’s a little depressing. I’ll check out the Telegram option. I’m totally unfamiliar. Could you provide details to prime the pump? Also, I did find the Grafana forums as soon as I sent to this forum… :roll_eyes:

Only complete instructions I’ve found are in Finnish, but

Telegram bot creation instructions are here: https://core.telegram.org/bots
and grafana configuration instructions I used are here:
https://community.grafana.com/t/telegram-alert-channel-configuration/242

I have email alerts working fine on my Raspberry Pi Zero W which I setup recently.

I am using my own SMTP server, which makes debugging a bit easier in case the problem lies with the mail server (ie. mail getting rejected).

grafana.ini

[smtp]
enabled = true
host = mail.server.com:465    
user = account@server.com
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
password = PASSWORD
;cert_file =
;key_file =
;skip_verify = false
from_address = rpi@server.com
from_name = Grafana
# EHLO identity in SMTP dialog (defaults to instance_name)
ehlo_identity = grafana.server.com

Make sure your server accepts the mail (ie. accounts exist, IP white listed, etc). Not sure how to debug Grafana though, did you check the Grafana logs?

Before setting up Grafana/SMTP I made sure my Pi can send mail fine and it gets accepted by my mail server (I use Postfix for system email).

This guy seems to work with FakeSMTP to get it to work.

1 Like

Where exactly are the grafana logs? Or even where is the install directory? I’ve searched for this information and looked in the usual places on my Pi itself but have come up empty.

With your google account, do you have two factor authentication enabled?

If so you will need to create an application specific password for use with Grafana, once done this can be entered into your config.

This link explains how to do that:
https://support.google.com/mail/answer/185833?hl=en

I have this working on my RPI 3 at home, if you need further help I can upload my config when I am at home.

1 Like

I don’t have two factor set up. I think we figured out that this was a problem with the set up of the company firewall.