@cryptotaxi247 / netdata-1 / commits / 07985335e

Fix table formatting (custom exporter) (#15668)

* Fix table formatting (custom exporter) * Update metadata.yaml * Update metadata.yaml

Shyam Sreevalsan committed Aug 1, 2023 at 15:38 UTC 07985335e3f1c5b2e633064133a394d837c83290
1 file changed +49 -46
health/notifications/custom/metadata.yaml
+49 -46
@@ -34,11 +34,12 @@
34 required: true
35 - name: 'DEFAULT_RECIPIENT_CUSTOM'
36 default_value: ''
37 - description: "The `DEFAULT_RECIPIENT_CUSTOM` value is dependent on how you handle the `${to}` variable inside the `custom_sender()` function."
37 + description: "This value is dependent on how you handle the `${to}` variable inside the `custom_sender()` function."
38 required: true
39 detailed_description: >
40 - All roles will default to this variable if left unconfigured. You can edit `DEFAULT_RECIPIENT_CUSTOM` with the variable you want, in the following entries at the bottom of the same file:
41 - ```
40 + You can have different `${to}` variables per **role**, by editing `DEFAULT_RECIPIENT_CUSTOM` with the variable you want, in the following entries at the bottom of the file:
41 +
42 + ```conf
43 role_recipients_custom[sysadmin]="systems"
44 role_recipients_custom[domainadmin]="domains"
45 role_recipients_custom[dba]="databases systems"
@@ -51,8 +52,9 @@
52 description: "You can look at the other senders in `/usr/libexec/netdata/plugins.d/alarm-notify.sh` for examples of how to modify the function in this configuration file."
53 required: false
54 detailed_description: >
54 - 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:
55 - ```
55 + 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:
56 +
57 + ```sh
58 custom_sender() {
59 # example human readable SMS
60 local msg="${host} ${status_message}: ${alarm} ${raised_for}"
@@ -62,7 +64,7 @@
64
65 # a space separated list of the recipients to send alarms to
66 to="${1}"
65 -
67 +
68 for phone in ${to}; do
69 httpcode=$(docurl -X POST \
70 --data-urlencode "From=XXX" \
@@ -80,46 +82,47 @@
82 done
83 }
84 ```
83 - The supported variables that you can use for the function's msg variable are:
84 - ```
85 - Variable name Description
86 - ${alarm} Like "name = value units"
87 - ${status_message} Like "needs attention", "recovered", "is critical"
88 - ${severity} Like "Escalated to CRITICAL", "Recovered from WARNING"
89 - ${raised_for} Like "(alarm was raised for 10 minutes)"
90 - ${host} The host generated this event
91 - ${url_host} Same as ${host} but URL encoded
92 - ${unique_id} The unique id of this event
93 - ${alarm_id} The unique id of the alarm that generated this event
94 - ${event_id} The incremental id of the event, for this alarm id
95 - ${when} The timestamp this event occurred
96 - ${name} The name of the alarm, as given in netdata health.d entries
97 - ${url_name} Same as ${name} but URL encoded
98 - ${chart} The name of the chart (type.id)
99 - ${url_chart} Same as ${chart} but URL encoded
100 - ${family} The family of the chart
101 - ${url_family} Same as ${family} but URL encoded
102 - ${status} The current status : REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
103 - ${old_status} The previous status: REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL
104 - ${value} The current value of the alarm
105 - ${old_value} The previous value of the alarm
106 - ${src} The line number and file the alarm has been configured
107 - ${duration} The duration in seconds of the previous alarm state
108 - ${duration_txt} Same as ${duration} for humans
109 - ${non_clear_duration} The total duration in seconds this is/was non-clear
110 - ${non_clear_duration_txt} Same as ${non_clear_duration} for humans
111 - ${units} The units of the value
112 - ${info} A short description of the alarm
113 - ${value_string} Friendly value (with units)
114 - ${old_value_string} Friendly old value (with units)
115 - ${image} The URL of an image to represent the status of the alarm
116 - ${color} A color in AABBCC format for the alarm
117 - ${goto_url} The URL the user can click to see the netdata dashboard
118 - ${calc_expression} The expression evaluated to provide the value for the alarm
119 - ${calc_param_values} The value of the variables in the evaluated expression
120 - ${total_warnings} The total number of alarms in WARNING state on the host
121 - ${total_critical} The total number of alarms in CRITICAL state on the host
122 - ```
85 +
86 + The supported variables that you can use for the function's `msg` variable are:
87 +
88 + | Variable name | Description |
89 + |:---------------------------:|:---------------------------------------------------------------------------------|
90 + | `${alarm}` | Like "name = value units" |
91 + | `${status_message}` | Like "needs attention", "recovered", "is critical" |
92 + | `${severity}` | Like "Escalated to CRITICAL", "Recovered from WARNING" |
93 + | `${raised_for}` | Like "(alarm was raised for 10 minutes)" |
94 + | `${host}` | The host generated this event |
95 + | `${url_host}` | Same as ${host} but URL encoded |
96 + | `${unique_id}` | The unique id of this event |
97 + | `${alarm_id}` | The unique id of the alarm that generated this event |
98 + | `${event_id}` | The incremental id of the event, for this alarm id |
99 + | `${when}` | The timestamp this event occurred |
100 + | `${name}` | The name of the alarm, as given in netdata health.d entries |
101 + | `${url_name}` | Same as ${name} but URL encoded |
102 + | `${chart}` | The name of the chart (type.id) |
103 + | `${url_chart}` | Same as ${chart} but URL encoded |
104 + | `${family}` | The family of the chart |
105 + | `${url_family}` | Same as ${family} but URL encoded |
106 + | `${status}` | The current status : REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL |
107 + | `${old_status}` | The previous status: REMOVED, UNINITIALIZED, UNDEFINED, CLEAR, WARNING, CRITICAL |
108 + | `${value}` | The current value of the alarm |
109 + | `${old_value}` | The previous value of the alarm |
110 + | `${src}` | The line number and file the alarm has been configured |
111 + | `${duration}` | The duration in seconds of the previous alarm state |
112 + | `${duration_txt}` | Same as ${duration} for humans |
113 + | `${non_clear_duration}` | The total duration in seconds this is/was non-clear |
114 + | `${non_clear_duration_txt}` | Same as ${non_clear_duration} for humans |
115 + | `${units}` | The units of the value |
116 + | `${info}` | A short description of the alarm |
117 + | `${value_string}` | Friendly value (with units) |
118 + | `${old_value_string}` | Friendly old value (with units) |
119 + | `${image}` | The URL of an image to represent the status of the alarm |
120 + | `${color}` | A color in AABBCC format for the alarm |
121 + | `${goto_url}` | The URL the user can click to see the netdata dashboard |
122 + | `${calc_expression}` | The expression evaluated to provide the value for the alarm |
123 + | `${calc_param_values}` | The value of the variables in the evaluated expression |
124 + | `${total_warnings}` | The total number of alarms in WARNING state on the host |
125 + | `${total_critical}` | The total number of alarms in CRITICAL state on the host |
126 examples:
127 folding:
128 enabled: true