@cryptotaxi247 / netdata-1 / commits / cc2b9d2b4

Make custom notification's instructions clearer (#6181)

* Make custom notification's istructions clearer Related to #3641 * Update README.md

Chris Akritidis committed May 31, 2019 at 17:47 UTC cc2b9d2b4c1b3fbac91ac64b2f0e81c7850e344c
1 file changed +43 -41
health/notifications/custom/README.md
+43 -41
@@ -1,11 +1,13 @@
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.
3 +Netdata allows you to send custom notifications to any endpoint you choose.
4 +
5 +To configure custom notifications, you will need to customize `health_alarm_notify.conf`. You can look at the other senders in `/usr/libexec/netdata/plugins.d/alarm-notify.sh` for examples of how to modify the `custom_sender()` function in `health_alarm_notify.conf`. Ensure you follow the instructions of changing any configuration file to [persist your configuration](../../../docs/configuration-guide.md#persist-my-configuration).
6 +
7 As with other notifications, you will also need to define the recipient list in `DEFAULT_RECIPIENT_CUSTOM` and/or the `role_recipients_custom` array.
8
8 -The following is a sample `custom_sender` function to send an SMS via an imaginary HTTPS endpoint to the SMS gateway:
9 +The following is a sample `custom_sender` function in `health_alarm_notify.conf`, to send an SMS via an imaginary HTTPS endpoint to the SMS gateway:
10 +
11 ```
12 custom_sender() {
13 # example human readable SMS
@@ -37,45 +39,45 @@ The following is a sample `custom_sender` function to send an SMS via an imagina
39
40 Variables available to the custom_sender:
41
40 - - ${to_custom} the list of recipients for the alarm
41 - - ${host} the host generated this event
42 - - ${url_host} same as ${host} but URL encoded
43 - - ${unique_id} the unique id of this event
44 - - ${alarm_id} the unique id of the alarm that generated this event
45 - - ${event_id} the incremental id of the event, for this alarm id
46 - - ${when} the timestamp this event occurred
47 - - ${name} the name of the alarm, as given in netdata health.d entries
48 - - ${url_name} same as ${name} but URL encoded
49 - - ${chart} the name of the chart (type.id)
50 - - ${url_chart} same as ${chart} but URL encoded
51 - - ${family} the family of the chart
52 - - ${url_family} same as ${family} but URL encoded
53 - - ${status} the current status : REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
54 - - ${old_status} the previous status: REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
55 - - ${value} the current value of the alarm
56 - - ${old_value} the previous value of the alarm
57 - - ${src} the line number and file the alarm has been configured
58 - - ${duration} the duration in seconds of the previous alarm state
59 - - ${duration_txt} same as ${duration} for humans
60 - - ${non_clear_duration} the total duration in seconds this is/was non-clear
61 - - ${non_clear_duration_txt} same as ${non_clear_duration} for humans
62 - - ${units} the units of the value
63 - - ${info} a short description of the alarm
64 - - ${value_string} friendly value (with units)
65 - - ${old_value_string} friendly old value (with units)
66 - - ${image} the URL of an image to represent the status of the alarm
67 - - ${color} a color in #AABBCC format for the alarm
68 - - ${goto_url} the URL the user can click to see the netdata dashboard
69 - - ${calc_expression} the expression evaluated to provide the value for the alarm
70 - - ${calc_param_values} the value of the variables in the evaluated expression
71 - - ${total_warnings} the total number of alarms in WARNING state on the host
72 - - ${total_critical} the total number of alarms in CRITICAL state on the host
42 + - `${to_custom}` the list of recipients for the alarm
43 + - `${host}` the host generated this event
44 + - `${url_host}` same as `${host}` but URL encoded
45 + - `${unique_id}` the unique id of this event
46 + - `${alarm_id}` the unique id of the alarm that generated this event
47 + - `${event_id}` the incremental id of the event, for this alarm id
48 + - `${when}` the timestamp this event occurred
49 + - `${name}` the name of the alarm, as given in netdata health.d entries
50 + - `${url_name}` same as `${name}` but URL encoded
51 + - `${chart}` the name of the chart (type.id)
52 + - `${url_chart}` same as `${chart}` but URL encoded
53 + - `${family}` the family of the chart
54 + - `${url_family}` same as `${family}` but URL encoded
55 + - `${status}` the current status : REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
56 + - `${old_status}` the previous status: REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
57 + - `${value}` the current value of the alarm
58 + - `${old_value}` the previous value of the alarm
59 + - `${src}` the line number and file the alarm has been configured
60 + - `${duration}` the duration in seconds of the previous alarm state
61 + - `${duration_txt}` same as `${duration}` for humans
62 + - `${non_clear_duration}` the total duration in seconds this is/was non-clear
63 + - `${non_clear_duration_txt}` same as `${non_clear_duration}` for humans
64 + - `${units}` the units of the value
65 + - `${info}` a short description of the alarm
66 + - `${value_string}` friendly value (with units)
67 + - `${old_value_string}` friendly old value (with units)
68 + - `${image}` the URL of an image to represent the status of the alarm
69 + - `${color}` a color in #AABBCC format for the alarm
70 + - `${goto_url}` the URL the user can click to see the netdata dashboard
71 + - `${calc_expression}` the expression evaluated to provide the value for the alarm
72 + - `${calc_param_values}` the value of the variables in the evaluated expression
73 + - `${total_warnings}` the total number of alarms in WARNING state on the host
74 + - `${total_critical}` the total number of alarms in CRITICAL state on the host
75
76 The following are more human friendly:
77
76 - - ${alarm} like "name = value units"
77 - - ${status_message} like "needs attention", "recovered", "is critical"
78 - - ${severity} like "Escalated to CRITICAL", "Recovered from WARNING"
79 - - ${raised_for} like "(alarm was raised for 10 minutes)"
78 + - `${alarm}` like "name = value units"
79 + - `${status_message}` like "needs attention", "recovered", "is critical"
80 + - `${severity}` like "Escalated to CRITICAL", "Recovered from WARNING"
81 + - `${raised_for}` like "(alarm was raised for 10 minutes)"
82
83 [![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fhealth%2Fnotifications%2Fcustom%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()