Send custom docs (#5703)
* Improve custom notifications documentation * Updated main README with link to custom * Fix lists for HTML generation * Another effort to fix the lists
Chris Akritidis committed
Mar 27, 2019 at 19:24 UTC
74727c8b0ce4868e738f24753cc40d922c77636e
5 files changed
+69
-1
README.md
+1
-1
@@ -246,7 +246,7 @@ This is what you should expect from Netdata:
246
247
### Health Monitoring & Alarms
248
- **Sophisticated alerting** - comes with hundreds of alarms, **out of the box**! Supports dynamic thresholds, hysteresis, alarm templates, multiple role-based notification methods.
249
-- **Notifications**: [alerta.io](health/notifications/alerta/), [amazon sns](health/notifications/awssns/), [discordapp.com](health/notifications/discord/), [email](health/notifications/email/), [flock.com](health/notifications/flock/), [irc](health/notifications/irc/), [kavenegar.com](health/notifications/kavenegar/), [messagebird.com](health/notifications/messagebird/), [pagerduty.com](health/notifications/pagerduty/), [prowl](health/notifications/prowl/), [pushbullet.com](health/notifications/pushbullet/), [pushover.net](health/notifications/pushover/), [rocket.chat](health/notifications/rocketchat/), [slack.com](health/notifications/slack/), [smstools3](health/notifications/smstools3/), [syslog](health/notifications/syslog/), [telegram.org](health/notifications/telegram/), [twilio.com](health/notifications/twilio/), [web](health/notifications/web/).
249
+- **Notifications**: [alerta.io](health/notifications/alerta/), [amazon sns](health/notifications/awssns/), [discordapp.com](health/notifications/discord/), [email](health/notifications/email/), [flock.com](health/notifications/flock/), [irc](health/notifications/irc/), [kavenegar.com](health/notifications/kavenegar/), [messagebird.com](health/notifications/messagebird/), [pagerduty.com](health/notifications/pagerduty/), [prowl](health/notifications/prowl/), [pushbullet.com](health/notifications/pushbullet/), [pushover.net](health/notifications/pushover/), [rocket.chat](health/notifications/rocketchat/), [slack.com](health/notifications/slack/), [smstools3](health/notifications/smstools3/), [syslog](health/notifications/syslog/), [telegram.org](health/notifications/telegram/), [twilio.com](health/notifications/twilio/), [web](health/notifications/web/) and [custom notifications](health/notifications/custom/).
250
251
### Integrations
252
- **time-series dbs** - can archive its metrics to `graphite`, `opentsdb`, `prometheus`, json document DBs, in the same or lower resolution (lower: to prevent it from congesting these servers due to the amount of data collected).
health/notifications/Makefile.am
+1
@@ -44,3 +44,4 @@ include syslog/Makefile.inc
44
include telegram/Makefile.inc
45
include twilio/Makefile.inc
46
include web/Makefile.inc
47
+include custom/Makefile.inc
\ No newline at end of file
health/notifications/custom/Makefile.inc
new
+12
@@ -0,0 +1,12 @@
1
+# SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+# THIS IS NOT A COMPLETE Makefile
4
+# IT IS INCLUDED BY ITS PARENT'S Makefile.am
5
+# IT IS REQUIRED TO REFERENCE ALL FILES RELATIVE TO THE PARENT
6
+
7
+# install these files
8
+dist_noinst_DATA += \
9
+ custom/README.md \
10
+ custom/Makefile.inc \
11
+ $(NULL)
12
+
health/notifications/custom/README.md
new
+51
@@ -0,0 +1,51 @@
1
+# Custom
2
+
3
+Netdata allows you to send custom notifications, to any endpoint you choose.
4
+To configure custom notifications, you will need to define the `custom_sender()` function in `health_alarm_notify.conf`
5
+You can look at the other senders in `/usr/libexec/netdata/plugins.d/alarm-notify.sh` for examples.
6
+As with other notifications, you will also need to define the recipient list in `DEFAULT_RECIPIENT_CUSTOM` and/or the `role_recipients_custom` array.
7
+
8
+Variables available to the custom_sender:
9
+
10
+ - ${to_custom} the list of recipients for the alarm
11
+ - ${host} the host generated this event
12
+ - ${url_host} same as ${host} but URL encoded
13
+ - ${unique_id} the unique id of this event
14
+ - ${alarm_id} the unique id of the alarm that generated this event
15
+ - ${event_id} the incremental id of the event, for this alarm id
16
+ - ${when} the timestamp this event occurred
17
+ - ${name} the name of the alarm, as given in netdata health.d entries
18
+ - ${url_name} same as ${name} but URL encoded
19
+ - ${chart} the name of the chart (type.id)
20
+ - ${url_chart} same as ${chart} but URL encoded
21
+ - ${family} the family of the chart
22
+ - ${url_family} same as ${family} but URL encoded
23
+ - ${status} the current status : REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
24
+ - ${old_status} the previous status: REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
25
+ - ${value} the current value of the alarm
26
+ - ${old_value} the previous value of the alarm
27
+ - ${src} the line number and file the alarm has been configured
28
+ - ${duration} the duration in seconds of the previous alarm state
29
+ - ${duration_txt} same as ${duration} for humans
30
+ - ${non_clear_duration} the total duration in seconds this is/was non-clear
31
+ - ${non_clear_duration_txt} same as ${non_clear_duration} for humans
32
+ - ${units} the units of the value
33
+ - ${info} a short description of the alarm
34
+ - ${value_string} friendly value (with units)
35
+ - ${old_value_string} friendly old value (with units)
36
+ - ${image} the URL of an image to represent the status of the alarm
37
+ - ${color} a color in #AABBCC format for the alarm
38
+ - ${goto_url} the URL the user can click to see the netdata dashboard
39
+ - ${calc_expression} the expression evaluated to provide the value for the alarm
40
+ - ${calc_param_values} the value of the variables in the evaluated expression
41
+ - ${total_warnings} the total number of alarms in WARNING state on the host
42
+ - ${total_critical} the total number of alarms in CRITICAL state on the host
43
+
44
+The following are more human friendly:
45
+
46
+ - ${alarm} like "name = value units"
47
+ - ${status_message} like "needs attention", "recovered", "is critical"
48
+ - ${severity} like "Escalated to CRITICAL", "Recovered from WARNING"
49
+ - ${raised_for} like "(alarm was raised for 10 minutes)"
50
+
51
+[]()
health/notifications/health_alarm_notify.conf
+4
@@ -752,6 +752,10 @@ custom_sender() {
752
# ${image} the URL of an image to represent the status of the alarm
753
# ${color} a color in #AABBCC format for the alarm
754
# ${goto_url} the URL the user can click to see the netdata dashboard
755
+ # ${calc_expression} the expression evaluated to provide the value for the alarm
756
+ # ${calc_param_values} the value of the variables in the evaluated expression
757
+ # ${total_warnings} the total number of alarms in WARNING state on the host
758
+ # ${total_critical} the total number of alarms in CRITICAL state on the host
759
760
# these are more human friendly:
761
# ${alarm} like "name = value units"