Create Email Alert Notification Channel
I want to send alerts using Grafana, but I need to first create an alert notification channel.
In this lecture I will create a new channel for email alerts.
If you don't have an SMTP server available, you can install a local send only SMTP server on your Grafana server itself.
sudo apt install mailutils
At the prompt, I choose Internet Site
After the install is finished, I need to configure the Postfix SMTP server.
sudo nano /etc/postfix/main.cf
I edit 2 values at the bottom being,
inet_interfaces = loopback-only inet_protocols = ipv4
Then restart postfix
sudo systemctl restart postfix
I can test the SMTP server sends emails using
echo "This is the body" | mail -s "This is the subject" -a "FROM:firstname.lastname@example.org" your@email-address
Next to configure Grafana SMTP settings
sudo nano /etc/grafana/grafana.ini
Find the SMTP specific settings, uncomment and edit
[smtp] enabled = true host = localhost:25 skip_verify = true from_address = admin@[your grafana domain name or ip] from_name = Grafana
sudo service grafana-server restart
Go back into Grafana, into your new Email notification channel settings and try to send a test email.
Check your SPAM folder.
If you have trouble receiving emails at your email provider, then please see my SMTP Troubleshooting page in my Zabbix course at https://sbcode.net/zabbix/setup-smtp/#troubleshooting