As part of its AWS suite, Amazon provides a notification broker service called ‘Simple Notification Service’ (SNS). Amazon SNS works similarly to Netdata’s own notification system, allowing to dispatch a single notification to multiple subscribers of different types. Among other things, SNS supports sending notifications to:
/ as a home directory. The setup depends on the distribution, but /var/lib/netdata is the recommended directory. If you are using Netdata as a dedicated user, the permissions will already be correct.The following options can be defined for this notification
| Option | Description | Default | Required |
|---|---|---|---|
| aws path | The full path of the aws command. If empty, the system $PATH will be searched for it. If not found, Amazon SNS notifications will be silently disabled. | yes | |
| SEND_AWSNS | Set SEND_AWSNS to YES | YES | yes |
| AWSSNS_MESSAGE_FORMAT | Set AWSSNS_MESSAGE_FORMAT to the string that you want the alert to be sent into. | ${status} on ${host} at ${date}: ${chart} ${value_string} | yes |
| DEFAULT_RECIPIENT_AWSSNS | Set DEFAULT_RECIPIENT_AWSSNS to the Topic ARN you noted down upon creating the Topic. | yes |
For the complete list of supported notification variables, see the Alert Notification Variables section in the Health Reference.
All roles will default to this variable if left unconfigured.
You can have different recipient Topics per role, by editing DEFAULT_RECIPIENT_AWSSNS with the Topic ARN you want, in the following entries at the bottom of the same file:
role_recipients_awssns[sysadmin]="arn:aws:sns:us-east-2:123456789012:Systems"
role_recipients_awssns[domainadmin]="arn:aws:sns:us-east-2:123456789012:Domains"
role_recipients_awssns[dba]="arn:aws:sns:us-east-2:123456789012:Databases"
role_recipients_awssns[webmaster]="arn:aws:sns:us-east-2:123456789012:Development"
role_recipients_awssns[proxyadmin]="arn:aws:sns:us-east-2:123456789012:Proxy"
role_recipients_awssns[sitemgr]="arn:aws:sns:us-east-2:123456789012:Sites"
The configuration file name for this integration is health_alarm_notify.conf.
You can edit the configuration file using the edit-config script from the
Netdata config directory.
cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config health_alarm_notify.conf
An example working configuration would be:
```text
#------------------------------------------------------------------------------
# Amazon SNS notifications
SEND_AWSSNS="YES"
AWSSNS_MESSAGE_FORMAT="${status} on ${host} at ${date}: ${chart} ${value_string}"
DEFAULT_RECIPIENT_AWSSNS="arn:aws:sns:us-east-2:123456789012:MyTopic"
You can run the following command by hand, to test alerts configuration:
# become user netdata
sudo su -s /bin/bash netdata
# enable debugging info on the console
export NETDATA_ALARM_NOTIFY_DEBUG=1
# send test alarms to sysadmin
/usr/libexec/netdata/plugins.d/alarm-notify.sh test
# send test alarms to any role
/usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE"
Note that this will test all alert mechanisms for the selected role.
Want a personalised demo of Netdata for your use case?