Email Agent alert notifications
Learn how to send notifications via Email using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more.
This file assumes you have read the Introduction to Agent alert notifications, detailing how the Netdata Agent's alert notification method works.
Email notifications look like this:
You will need:
sendmailcommand for email alerts to work. Almost all MTAs provide a
Netdata sends all emails as user
netdata, so make sure your
sendmailworks for local users.
If you are using our Docker images, or are running Netdata on a system that does not have a working
sendmailcommand, see the section below about using msmtp in place of sendmail.
terminal access to the Agent you wish to configure
Configure Netdata to send alerts via Email
This file mentions editing configuration files.
- To edit configuration files in a safe way, we provide the
edit configscript located in your Netdata config directory (typically is
/etc/netdata) that creates the proper file and opens it in an editor automatically.
Note that to run the script you need to be inside your Netdata config directory.
It is recommended to use this way for configuring Netdata.
health_alarm_notify.conf, changes to this file do not require restarting Netdata:
You can change
EMAIL_SENDERto the email address sending the notifications, the default is the system user Netdata runs as, usually being
Supported formats are:
EMAIL_SENDER="User Name <user@domain>"
EMAIL_SENDER="'User Name' <user@domain>"
EMAIL_SENDER="\"User Name\" <user@domain>"
DEFAULT_RECIPIENT_EMAILto the email address you want the email to be sent by default.
You can define multiple email addresses like this:
[email protected] [email protected].
All roles will default to this variable if left unconfigured.
There are also other optional configuration entries that can be found in the same section of the file.
You can then have different email addresses per role, by editing
DEFAULT_RECIPIENT_EMAIL with the email address you want, in the following entries at the bottom of the same file:
role_recipients_email[dba]="[email protected] [email protected]"
role_recipients_email[webmaster]="[email protected] [email protected]"
An example of a working configuration would be:
Every notification email (both the plain text and the rich html versions) from the Netdata agent, contain a set of custom email headers that can be used for filtering using an email client. Example:
Using msmtp instead of sendmail
msmtp provides a simple alternative to a full-blown local mail server and
that will still allow you to send email notifications. It comes pre-installed in our Docker images, and is available
on most distributions in the system package repositories.
To use msmtp with Netdata for sending email alerts:
If it’s not already installed, install msmtp. Most distributions have it in their package repositories with the package name
health_alarm_notify.confto point to the location of
# The full path to the sendmail command.
# If empty, the system $PATH will be searched for it.
# If not found, email notifications will be disabled (silently).
Login as netdata:
(sudo) su -s /bin/bash netdata
~/.msmtprcas shown in the documentation.
Finally set the appropriate permissions on the
chmod 600 ~/.msmtprc
Test the notification method
To test this alert notification method refer to the "Testing Alert Notifications" section of the Agent alert notifications page.
Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.