Chris Akritidis 84bac1f58e Add prowl to list of methods checked for enablement of notifications (#6022) 5 лет назад
..
alerta 6f73c3be9a Fixed typo (#5054) 6 лет назад
awssns 415f57c5bf Ga (#4938) 6 лет назад
custom fc74a508be Add sample implementation to custom_sender (#5992) 5 лет назад
discord 415f57c5bf Ga (#4938) 6 лет назад
email 415f57c5bf Ga (#4938) 6 лет назад
flock 415f57c5bf Ga (#4938) 6 лет назад
irc 415f57c5bf Ga (#4938) 6 лет назад
kavenegar 415f57c5bf Ga (#4938) 6 лет назад
messagebird 415f57c5bf Ga (#4938) 6 лет назад
pagerduty 415f57c5bf Ga (#4938) 6 лет назад
prowl 780fd606ee alarm-notify: Add Prowl integration for iOS users. (#5132) 6 лет назад
pushbullet 415f57c5bf Ga (#4938) 6 лет назад
pushover 415f57c5bf Ga (#4938) 6 лет назад
rocketchat 415f57c5bf Ga (#4938) 6 лет назад
slack 288787a54c Correct instructions on Slack webhooks (#6016) 5 лет назад
smstools3 e0f69fd8be Fix smstools3 error handling (#5770) 6 лет назад
syslog 415f57c5bf Ga (#4938) 6 лет назад
telegram 415f57c5bf Ga (#4938) 6 лет назад
twilio 415f57c5bf Ga (#4938) 6 лет назад
web 415f57c5bf Ga (#4938) 6 лет назад
Makefile.am 74727c8b0c Send custom docs (#5703) 6 лет назад
README.md 415f57c5bf Ga (#4938) 6 лет назад
alarm-email.sh e76aac74e6 moved related wiki pages into the repo (#4428) 6 лет назад
alarm-notify.sh.in 84bac1f58e Add prowl to list of methods checked for enablement of notifications (#6022) 5 лет назад
alarm-test.sh e76aac74e6 moved related wiki pages into the repo (#4428) 6 лет назад
health_alarm_notify.conf 288787a54c Correct instructions on Slack webhooks (#6016) 5 лет назад
health_email_recipients.conf e76aac74e6 moved related wiki pages into the repo (#4428) 6 лет назад

README.md

Netdata alarm notifications

The exec line in health configuration defines an external script that will be called once the alarm is triggered. The default script is alarm-notify.sh.

You can change the default script globally by editing /etc/netdata/netdata.conf.

alarm-notify.sh is capable of sending notifications:

  • to multiple recipients
  • using multiple notification methods
  • filtering severity per recipient

It uses roles. For example sysadmin, webmaster, dba, etc.

Each alarm is assigned to one or more roles, using the to line of the alarm configuration. Then alarm-notify.sh uses its own configuration file /etc/netdata/health_alarm_notify.conf the default is here (to edit it on your system run /etc/netdata/edit-config health_alarm_notify.conf) to find the destination address of the notification for each method.

Each role may have one or more destinations.

So, for example the sysadmin role may send:

  1. emails to admin1@example.com and admin2@example.com
  2. pushover.net notifications to USERTOKENS A, B and C.
  3. pushbullet.com push notifications to admin1@example.com and admin2@example.com
  4. messages to slack.com channel #alarms and #systems.
  5. messages to Discord channels #alarms and #systems.

Configuration

Edit /etc/netdata/health_alarm_notify.conf by running /etc/netdata/edit-config health_alarm_notify.conf:

  • settings per notification method:

all notification methods except email, require some configuration (i.e. API keys, tokens, destination rooms, channels, etc).

  1. recipients per role per notification method

Testing Notifications

You can run the following command by hand, to test alarms configuration:

# become user netdata
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"

If you need to dig even deeper, you can trace the execution with bash -x. Note that in test mode, alarm-notify.sh calls itself with many more arguments. So first do

 bash -x /usr/libexec/netdata/plugins.d/alarm-notify.sh test

Then look in the output for the alarm-notify.sh calls and run the one you want to trace with bash -x. [analytics]()