Using email alerts through Grafana

#1

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!

#2

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:

#3

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:

#4

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

#5

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
#6

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.