Use brackets around info variables (#14206)
* use brackets around vars * update doc * change doc * try fix codacy * fix 2
Emmanuel Vasilakis committed
Jan 5, 2023 at 15:42 UTC
6898558b7278fa6ac80a2c91b2854d08b0360fe3
15 files changed
+75
-73
database/rrdcalc.c
+8
-6
@@ -74,18 +74,16 @@ static STRING *rrdcalc_replace_variables_with_rrdset_labels(const char *line, RR
74
char var[RRDCALC_VAR_MAX];
75
char *m, *lbl_value = NULL;
76
77
- while ((m = strchr(temp + pos, '$'))) {
77
+ while ((m = strchr(temp + pos, '$')) && *(m+1) == '{') {
78
int i = 0;
79
char *e = m;
80
while (*e) {
81
+ var[i++] = *e;
82
82
- if (*e == ' ' || i == RRDCALC_VAR_MAX - 1)
83
+ if (*e == '}' || i == RRDCALC_VAR_MAX - 1)
84
break;
84
- else
85
- var[i] = *e;
85
86
e++;
88
- i++;
87
}
88
89
var[i] = '\0';
@@ -97,8 +95,12 @@ static STRING *rrdcalc_replace_variables_with_rrdset_labels(const char *line, RR
95
temp = buf;
96
}
97
else if (!strncmp(var, RRDCALC_VAR_LABEL, RRDCALC_VAR_LABEL_LEN)) {
98
+ char label_val[RRDCALC_VAR_MAX + 1] = { 0 };
99
+ strcpy(label_val, var+RRDCALC_VAR_LABEL_LEN);
100
+ label_val[i - RRDCALC_VAR_LABEL_LEN - 1] = '\0';
101
+
102
if(likely(rc->rrdset && rc->rrdset->rrdlabels)) {
101
- rrdlabels_get_value_to_char_or_null(rc->rrdset->rrdlabels, &lbl_value, var+RRDCALC_VAR_LABEL_LEN);
103
+ rrdlabels_get_value_to_char_or_null(rc->rrdset->rrdlabels, &lbl_value, label_val);
104
if (lbl_value) {
105
char *buf = find_and_replace(temp, var, lbl_value, m);
106
freez(temp);
database/rrdcalc.h
+2
-2
@@ -251,8 +251,8 @@ void rrdcalc_rrdhost_index_init(RRDHOST *host);
251
void rrdcalc_rrdhost_index_destroy(RRDHOST *host);
252
253
#define RRDCALC_VAR_MAX 100
254
-#define RRDCALC_VAR_FAMILY "$family"
255
-#define RRDCALC_VAR_LABEL "$label:"
254
+#define RRDCALC_VAR_FAMILY "${family}"
255
+#define RRDCALC_VAR_LABEL "${label:"
256
#define RRDCALC_VAR_LABEL_LEN (sizeof(RRDCALC_VAR_LABEL)-1)
257
258
#endif //NETDATA_RRDCALC_H
health/REFERENCE.md
+4
-4
@@ -548,13 +548,13 @@ alert information. Current variables supported are:
548
549
| variable | description |
550
| ---------| ----------- |
551
-| $family | Will be replaced by the family instance for the alert (e.g. eth0) |
552
-| $label: | Followed by a chart label name, this will replace the variable with the chart label's value |
551
+| ${family} | Will be replaced by the family instance for the alert (e.g. eth0) |
552
+| ${label:LABEL_NAME} | The variable will be replaced with the value of the label |
553
554
For example, an info field like the following:
555
556
```yaml
557
-info: average inbound utilization for the network interface $family over the last minute
557
+info: average inbound utilization for the network interface ${family} over the last minute
558
```
559
560
Will be rendered on the alert acting on interface `eth0` as:
@@ -567,7 +567,7 @@ An alert acting on a chart that has a chart label named e.g. `target`, with a va
567
can be enriched as follows:
568
569
```yaml
570
-info: average ratio of HTTP responses with unexpected status over the last 5 minutes for the site $label:target
570
+info: average ratio of HTTP responses with unexpected status over the last 5 minutes for the site ${label:target}
571
```
572
573
Will become:
health/health.d/cgroups.conf
+4
-4
@@ -51,7 +51,7 @@ component: Network
51
lookup: average -1m unaligned of received
52
units: packets
53
every: 10s
54
- info: average number of packets received by the network interface $label:device over the last minute
54
+ info: average number of packets received by the network interface ${label:device} over the last minute
55
56
template: cgroup_10s_received_packets_storm
57
on: cgroup.net_packets
@@ -66,7 +66,7 @@ component: Network
66
warn: $this > (($status >= $WARNING)?(200):(5000))
67
crit: $this > (($status == $CRITICAL)?(5000):(6000))
68
options: no-clear-notification
69
- info: ratio of average number of received packets for the network interface $label:device over the last 10 seconds, \
69
+ info: ratio of average number of received packets for the network interface ${label:device} over the last 10 seconds, \
70
compared to the rate over the last minute
71
to: sysadmin
72
@@ -121,7 +121,7 @@ component: Network
121
lookup: average -1m unaligned of received
122
units: packets
123
every: 10s
124
- info: average number of packets received by the network interface $label:device over the last minute
124
+ info: average number of packets received by the network interface ${label:device} over the last minute
125
126
template: k8s_cgroup_10s_received_packets_storm
127
on: k8s.cgroup.net_packets
@@ -136,6 +136,6 @@ component: Network
136
warn: $this > (($status >= $WARNING)?(200):(5000))
137
crit: $this > (($status == $CRITICAL)?(5000):(6000))
138
options: no-clear-notification
139
- info: ratio of average number of received packets for the network interface $label:device over the last 10 seconds, \
139
+ info: ratio of average number of received packets for the network interface ${label:device} over the last 10 seconds, \
140
compared to the rate over the last minute
141
to: sysadmin
health/health.d/consul.conf
+11
-11
@@ -10,7 +10,7 @@ component: Consul
10
units: status
11
warn: $this == 1
12
delay: down 5m multiplier 1.5 max 1h
13
- info: datacenter $label:datacenter cluster is unhealthy as reported by server $label:node_name
13
+ info: datacenter ${label:datacenter} cluster is unhealthy as reported by server ${label:node_name}
14
to: sysadmin
15
16
template: consul_autopilot_server_health_status
@@ -23,7 +23,7 @@ component: Consul
23
units: status
24
warn: $this == 1
25
delay: down 5m multiplier 1.5 max 1h
26
- info: server $label:node_name from datacenter $label:datacenter is unhealthy
26
+ info: server ${label:node_name} from datacenter ${label:datacenter} is unhealthy
27
to: sysadmin
28
29
template: consul_raft_leader_last_contact_time
@@ -37,7 +37,7 @@ component: Consul
37
warn: $this > (($status >= $WARNING) ? (150) : (200))
38
crit: $this > (($status == $CRITICAL) ? (200) : (500))
39
delay: down 5m multiplier 1.5 max 1h
40
- info: median time elapsed since leader server $label:node_name datacenter $label:datacenter was last able to contact the follower nodes
40
+ info: median time elapsed since leader server ${label:node_name} datacenter ${label:datacenter} was last able to contact the follower nodes
41
to: sysadmin
42
43
template: consul_raft_leadership_transitions
@@ -50,7 +50,7 @@ component: Consul
50
units: percentage
51
warn: $this > 0
52
delay: down 5m multiplier 1.5 max 1h
53
- info: there has been a leadership change and server $label:node_name datacenter $label:datacenter has become the leader
53
+ info: there has been a leadership change and server ${label:node_name} datacenter ${label:datacenter} has become the leader
54
to: sysadmin
55
56
template: consul_raft_thread_main_saturation
@@ -63,7 +63,7 @@ component: Consul
63
units: percentage
64
warn: $this > (($status >= $WARNING) ? (40) : (50))
65
delay: down 5m multiplier 1.5 max 1h
66
- info: average saturation of the main Raft goroutine on server $label:node_name datacenter $label:datacenter
66
+ info: average saturation of the main Raft goroutine on server ${label:node_name} datacenter ${label:datacenter}
67
to: sysadmin
68
69
template: consul_raft_thread_fsm_saturation
@@ -76,7 +76,7 @@ component: Consul
76
units: milliseconds
77
warn: $this > (($status >= $WARNING) ? (40) : (50))
78
delay: down 5m multiplier 1.5 max 1h
79
- info: average saturation of the FSM Raft goroutine on server $label:node_name datacenter $label:datacenter
79
+ info: average saturation of the FSM Raft goroutine on server ${label:node_name} datacenter ${label:datacenter}
80
to: sysadmin
81
82
template: consul_client_rpc_requests_exceeded
@@ -89,7 +89,7 @@ component: Consul
89
units: requests
90
warn: $this > (($status >= $WARNING) ? (0) : (5))
91
delay: down 5m multiplier 1.5 max 1h
92
- info: number of rate-limited RPC requests made by server $label:node_name datacenter $label:datacenter
92
+ info: number of rate-limited RPC requests made by server ${label:node_name} datacenter ${label:datacenter}
93
to: sysadmin
94
95
template: consul_client_rpc_requests_failed
@@ -102,7 +102,7 @@ component: Consul
102
units: requests
103
warn: $this > (($status >= $WARNING) ? (0) : (5))
104
delay: down 5m multiplier 1.5 max 1h
105
- info: number of failed RPC requests made by server $label:node_name datacenter $label:datacenter
105
+ info: number of failed RPC requests made by server ${label:node_name} datacenter ${label:datacenter}
106
to: sysadmin
107
108
template: consul_node_health_check_status
@@ -115,7 +115,7 @@ component: Consul
115
units: status
116
warn: $this != nan AND $this != 0
117
delay: down 5m multiplier 1.5 max 1h
118
- info: node health check $label:check_name has failed on server $label:node_name datacenter $label:datacenter
118
+ info: node health check ${label:check_name} has failed on server ${label:node_name} datacenter ${label:datacenter}
119
to: sysadmin
120
121
template: consul_service_health_check_status
@@ -128,7 +128,7 @@ component: Consul
128
units: status
129
warn: $this == 1
130
delay: down 5m multiplier 1.5 max 1h
131
- info: service health check $label:check_name for service $label:service_name has failed on server $label:node_name datacenter $label:datacenter
131
+ info: service health check ${label:check_name} for service ${label:service_name} has failed on server ${label:node_name} datacenter ${label:datacenter}
132
to: sysadmin
133
134
template: consul_gc_pause_time
@@ -142,5 +142,5 @@ component: Consul
142
warn: $this > (($status >= $WARNING) ? (1) : (2))
143
crit: $this > (($status >= $WARNING) ? (2) : (5))
144
delay: down 5m multiplier 1.5 max 1h
145
- info: time spent in stop-the-world garbage collection pauses on server $label:node_name datacenter $label:datacenter
145
+ info: time spent in stop-the-world garbage collection pauses on server ${label:node_name} datacenter ${label:datacenter}
146
to: sysadmin
health/health.d/disks.conf
+4
-4
@@ -23,7 +23,7 @@ component: Disk
23
warn: $this > (($status >= $WARNING ) ? (80) : (90))
24
crit: $this > (($status == $CRITICAL) ? (90) : (98))
25
delay: up 1m down 15m multiplier 1.5 max 1h
26
- info: disk $label:mount_point space utilization
26
+ info: disk ${label:mount_point} space utilization
27
to: sysadmin
28
29
template: disk_inode_usage
@@ -40,7 +40,7 @@ component: Disk
40
warn: $this > (($status >= $WARNING) ? (80) : (90))
41
crit: $this > (($status == $CRITICAL) ? (90) : (98))
42
delay: up 1m down 15m multiplier 1.5 max 1h
43
- info: disk $label:mount_point inode utilization
43
+ info: disk ${label:mount_point} inode utilization
44
to: sysadmin
45
46
@@ -147,7 +147,7 @@ component: Disk
147
every: 1m
148
warn: $this > 98 * (($status >= $WARNING) ? (0.7) : (1))
149
delay: down 15m multiplier 1.2 max 1h
150
- info: average percentage of time $label:device disk was busy over the last 10 minutes
150
+ info: average percentage of time ${label:device} disk was busy over the last 10 minutes
151
to: silent
152
153
@@ -169,5 +169,5 @@ component: Disk
169
every: 1m
170
warn: $this > 5000 * (($status >= $WARNING) ? (0.7) : (1))
171
delay: down 15m multiplier 1.2 max 1h
172
- info: average backlog size of the $label:device disk over the last 10 minutes
172
+ info: average backlog size of the ${label:device} disk over the last 10 minutes
173
to: silent
health/health.d/dns_query.conf
+1
-1
@@ -10,5 +10,5 @@ component: DNS
10
every: 10s
11
warn: $this != nan && $this != 1
12
delay: up 30s down 5m multiplier 1.5 max 1h
13
- info: DNS request type $label:record_type to server $label:server is unsuccessful
13
+ info: DNS request type ${label:record_type} to server ${label:server} is unsuccessful
14
to: sysadmin
health/health.d/httpcheck.conf
+5
-5
@@ -10,7 +10,7 @@ component: HTTP endpoint
10
calc: ($this < 75) ? (0) : ($this)
11
every: 5s
12
units: up/down
13
- info: HTTP endpoint $label:url liveness status
13
+ info: HTTP endpoint ${label:url} liveness status
14
to: silent
15
16
template: httpcheck_web_service_bad_content
@@ -25,7 +25,7 @@ component: HTTP endpoint
25
warn: $this >= 10 AND $this < 40
26
crit: $this >= 40
27
delay: down 5m multiplier 1.5 max 1h
28
- info: percentage of HTTP responses from $label:url with unexpected content in the last 5 minutes
28
+ info: percentage of HTTP responses from ${label:url} with unexpected content in the last 5 minutes
29
to: webmaster
30
31
template: httpcheck_web_service_bad_status
@@ -40,7 +40,7 @@ component: HTTP endpoint
40
warn: $this >= 10 AND $this < 40
41
crit: $this >= 40
42
delay: down 5m multiplier 1.5 max 1h
43
- info: percentage of HTTP responses from $label:url with unexpected status in the last 5 minutes
43
+ info: percentage of HTTP responses from ${label:url} with unexpected status in the last 5 minutes
44
to: webmaster
45
46
template: httpcheck_web_service_timeouts
@@ -55,7 +55,7 @@ component: HTTP endpoint
55
warn: $this >= 10 AND $this < 40
56
crit: $this >= 40
57
delay: down 5m multiplier 1.5 max 1h
58
- info: percentage of timed-out HTTP requests to $label:url in the last 5 minutes
58
+ info: percentage of timed-out HTTP requests to ${label:url} in the last 5 minutes
59
to: webmaster
60
61
template: httpcheck_web_service_no_connection
@@ -70,5 +70,5 @@ component: HTTP endpoint
70
warn: $this >= 10 AND $this < 40
71
crit: $this >= 40
72
delay: down 5m multiplier 1.5 max 1h
73
- info: percentage of failed HTTP requests to $label:url in the last 5 minutes
73
+ info: percentage of failed HTTP requests to ${label:url} in the last 5 minutes
74
to: webmaster
health/health.d/mdstat.conf
+2
-2
@@ -20,7 +20,7 @@ component: RAID
20
every: 10s
21
calc: $down
22
crit: $this > 0
23
- info: number of devices in the down state for the $label:device $label:raid_level array. \
23
+ info: number of devices in the down state for the ${label:device} ${label:raid_level} array. \
24
Any number > 0 indicates that the array is degraded.
25
to: sysadmin
26
@@ -35,7 +35,7 @@ component: RAID
35
every: 60s
36
warn: $this > 1024
37
delay: up 30m
38
- info: number of unsynchronized blocks for the $label:device $label:raid_level array
38
+ info: number of unsynchronized blocks for the ${label:device} ${label:raid_level} array
39
to: sysadmin
40
41
template: mdstat_nonredundant_last_collected
health/health.d/net.conf
+14
-14
@@ -15,7 +15,7 @@ component: Network
15
calc: ( $nic_speed_max > 0 ) ? ( $nic_speed_max) : ( nan )
16
units: Mbit
17
every: 10s
18
- info: network interface $label:device current speed
18
+ info: network interface ${label:device} current speed
19
20
template: 1m_received_traffic_overflow
21
on: net.net
@@ -31,7 +31,7 @@ component: Network
31
every: 10s
32
warn: $this > (($status >= $WARNING) ? (85) : (90))
33
delay: up 1m down 1m multiplier 1.5 max 1h
34
- info: average inbound utilization for the network interface $label:device over the last minute
34
+ info: average inbound utilization for the network interface ${label:device} over the last minute
35
to: sysadmin
36
37
template: 1m_sent_traffic_overflow
@@ -48,7 +48,7 @@ component: Network
48
every: 10s
49
warn: $this > (($status >= $WARNING) ? (85) : (90))
50
delay: up 1m down 1m multiplier 1.5 max 1h
51
- info: average outbound utilization for the network interface $label:device over the last minute
51
+ info: average outbound utilization for the network interface ${label:device} over the last minute
52
to: sysadmin
53
54
# -----------------------------------------------------------------------------
@@ -72,7 +72,7 @@ component: Network
72
lookup: sum -10m unaligned absolute of inbound
73
units: packets
74
every: 1m
75
- info: number of inbound dropped packets for the network interface $label:device in the last 10 minutes
75
+ info: number of inbound dropped packets for the network interface ${label:device} in the last 10 minutes
76
77
template: outbound_packets_dropped
78
on: net.drops
@@ -85,7 +85,7 @@ component: Network
85
lookup: sum -10m unaligned absolute of outbound
86
units: packets
87
every: 1m
88
- info: number of outbound dropped packets for the network interface $label:device in the last 10 minutes
88
+ info: number of outbound dropped packets for the network interface ${label:device} in the last 10 minutes
89
90
template: inbound_packets_dropped_ratio
91
on: net.packets
@@ -101,7 +101,7 @@ component: Network
101
every: 1m
102
warn: $this >= 2
103
delay: up 1m down 1h multiplier 1.5 max 2h
104
- info: ratio of inbound dropped packets for the network interface $label:device over the last 10 minutes
104
+ info: ratio of inbound dropped packets for the network interface ${label:device} over the last 10 minutes
105
to: sysadmin
106
107
template: outbound_packets_dropped_ratio
@@ -118,7 +118,7 @@ component: Network
118
every: 1m
119
warn: $this >= 2
120
delay: up 1m down 1h multiplier 1.5 max 2h
121
- info: ratio of outbound dropped packets for the network interface $label:device over the last 10 minutes
121
+ info: ratio of outbound dropped packets for the network interface ${label:device} over the last 10 minutes
122
to: sysadmin
123
124
template: wifi_inbound_packets_dropped_ratio
@@ -135,7 +135,7 @@ component: Network
135
every: 1m
136
warn: $this >= 10
137
delay: up 1m down 1h multiplier 1.5 max 2h
138
- info: ratio of inbound dropped packets for the network interface $label:device over the last 10 minutes
138
+ info: ratio of inbound dropped packets for the network interface ${label:device} over the last 10 minutes
139
to: sysadmin
140
141
template: wifi_outbound_packets_dropped_ratio
@@ -152,7 +152,7 @@ component: Network
152
every: 1m
153
warn: $this >= 10
154
delay: up 1m down 1h multiplier 1.5 max 2h
155
- info: ratio of outbound dropped packets for the network interface $label:device over the last 10 minutes
155
+ info: ratio of outbound dropped packets for the network interface ${label:device} over the last 10 minutes
156
to: sysadmin
157
158
# -----------------------------------------------------------------------------
@@ -171,7 +171,7 @@ component: Network
171
every: 1m
172
warn: $this >= 5
173
delay: down 1h multiplier 1.5 max 2h
174
- info: number of inbound errors for the network interface $label:device in the last 10 minutes
174
+ info: number of inbound errors for the network interface ${label:device} in the last 10 minutes
175
to: sysadmin
176
177
template: interface_outbound_errors
@@ -187,7 +187,7 @@ component: Network
187
every: 1m
188
warn: $this >= 5
189
delay: down 1h multiplier 1.5 max 2h
190
- info: number of outbound errors for the network interface $label:device in the last 10 minutes
190
+ info: number of outbound errors for the network interface ${label:device} in the last 10 minutes
191
to: sysadmin
192
193
# -----------------------------------------------------------------------------
@@ -211,7 +211,7 @@ component: Network
211
every: 1m
212
warn: $this > 0
213
delay: down 1h multiplier 1.5 max 2h
214
- info: number of FIFO errors for the network interface $label:device in the last 10 minutes
214
+ info: number of FIFO errors for the network interface ${label:device} in the last 10 minutes
215
to: sysadmin
216
217
# -----------------------------------------------------------------------------
@@ -234,7 +234,7 @@ component: Network
234
lookup: average -1m unaligned of received
235
units: packets
236
every: 10s
237
- info: average number of packets received by the network interface $label:device over the last minute
237
+ info: average number of packets received by the network interface ${label:device} over the last minute
238
239
template: 10s_received_packets_storm
240
on: net.packets
@@ -251,6 +251,6 @@ component: Network
251
warn: $this > (($status >= $WARNING)?(200):(5000))
252
crit: $this > (($status == $CRITICAL)?(5000):(6000))
253
options: no-clear-notification
254
- info: ratio of average number of received packets for the network interface $label:device over the last 10 seconds, \
254
+ info: ratio of average number of received packets for the network interface ${label:device} over the last 10 seconds, \
255
compared to the rate over the last minute
256
to: sysadmin
health/health.d/nvme.conf
+1
-1
@@ -11,5 +11,5 @@ component: Disk
11
every: 10s
12
crit: $this != nan AND $this != 0
13
delay: down 5m multiplier 1.5 max 2h
14
- info: NVMe device $label:device has critical warnings
14
+ info: NVMe device ${label:device} has critical warnings
15
to: sysadmin
health/health.d/ping.conf
+3
-3
@@ -12,7 +12,7 @@ component: Network
12
every: 10s
13
crit: $this == 0
14
delay: down 30m multiplier 1.5 max 2h
15
- info: network host $label:host reachability status
15
+ info: network host ${label:host} reachability status
16
to: sysadmin
17
18
template: ping_packet_loss
@@ -29,7 +29,7 @@ component: Network
29
warn: $this > $green
30
crit: $this > $red
31
delay: down 30m multiplier 1.5 max 2h
32
- info: packet loss percentage to the network host $label:host over the last 10 minutes
32
+ info: packet loss percentage to the network host ${label:host} over the last 10 minutes
33
to: sysadmin
34
35
template: ping_host_latency
@@ -46,5 +46,5 @@ component: Network
46
warn: $this > $green OR $max > $red
47
crit: $this > $red
48
delay: down 30m multiplier 1.5 max 2h
49
- info: average latency to the network host $label:host over the last 10 seconds
49
+ info: average latency to the network host ${label:host} over the last 10 seconds
50
to: sysadmin
health/health.d/portcheck.conf
+3
-3
@@ -10,7 +10,7 @@ component: TCP endpoint
10
calc: ($this < 75) ? (0) : ($this)
11
every: 5s
12
units: up/down
13
- info: TCP host $label:host port $label:port liveness status
13
+ info: TCP host ${label:host} port ${label:port} liveness status
14
to: silent
15
16
template: portcheck_connection_timeouts
@@ -25,7 +25,7 @@ component: TCP endpoint
25
warn: $this >= 10 AND $this < 40
26
crit: $this >= 40
27
delay: down 5m multiplier 1.5 max 1h
28
- info: percentage of timed-out TCP connections to host $label:host port $label:port in the last 5 minutes
28
+ info: percentage of timed-out TCP connections to host ${label:host} port ${label:port} in the last 5 minutes
29
to: sysadmin
30
31
template: portcheck_connection_fails
@@ -40,5 +40,5 @@ component: TCP endpoint
40
warn: $this >= 10 AND $this < 40
41
crit: $this >= 40
42
delay: down 5m multiplier 1.5 max 1h
43
- info: percentage of failed TCP connections to host $label:host port $label:port in the last 5 minutes
43
+ info: percentage of failed TCP connections to host ${label:host} port ${label:port} in the last 5 minutes
44
to: sysadmin
health/health.d/postgres.conf
+11
-11
@@ -58,7 +58,7 @@ component: PostgreSQL
58
warn: $this < (($status >= $WARNING) ? (70) : (60))
59
crit: $this < (($status == $CRITICAL) ? (60) : (50))
60
delay: down 15m multiplier 1.5 max 1h
61
- info: average cache hit ratio in db $label:database over the last minute
61
+ info: average cache hit ratio in db ${label:database} over the last minute
62
to: dba
63
64
template: postgres_db_transactions_rollback_ratio
@@ -72,7 +72,7 @@ component: PostgreSQL
72
every: 1m
73
warn: $this > (($status >= $WARNING) ? (0) : (2))
74
delay: down 15m multiplier 1.5 max 1h
75
- info: average aborted transactions percentage in db $label:database over the last five minutes
75
+ info: average aborted transactions percentage in db ${label:database} over the last five minutes
76
to: dba
77
78
template: postgres_db_deadlocks_rate
@@ -86,7 +86,7 @@ component: PostgreSQL
86
every: 1m
87
warn: $this > (($status >= $WARNING) ? (0) : (10))
88
delay: down 15m multiplier 1.5 max 1h
89
- info: number of deadlocks detected in db $label:database in the last minute
89
+ info: number of deadlocks detected in db ${label:database} in the last minute
90
to: dba
91
92
# Table alarms
@@ -104,7 +104,7 @@ component: PostgreSQL
104
warn: $this < (($status >= $WARNING) ? (70) : (60))
105
crit: $this < (($status == $CRITICAL) ? (60) : (50))
106
delay: down 15m multiplier 1.5 max 1h
107
- info: average cache hit ratio in db $label:database table $label:table over the last minute
107
+ info: average cache hit ratio in db ${label:database} table ${label:table} over the last minute
108
to: dba
109
110
template: postgres_table_index_cache_io_ratio
@@ -120,7 +120,7 @@ component: PostgreSQL
120
warn: $this < (($status >= $WARNING) ? (70) : (60))
121
crit: $this < (($status == $CRITICAL) ? (60) : (50))
122
delay: down 15m multiplier 1.5 max 1h
123
- info: average index cache hit ratio in db $label:database table $label:table over the last minute
123
+ info: average index cache hit ratio in db ${label:database} table ${label:table} over the last minute
124
to: dba
125
126
template: postgres_table_toast_cache_io_ratio
@@ -136,7 +136,7 @@ component: PostgreSQL
136
warn: $this < (($status >= $WARNING) ? (70) : (60))
137
crit: $this < (($status == $CRITICAL) ? (60) : (50))
138
delay: down 15m multiplier 1.5 max 1h
139
- info: average TOAST hit ratio in db $label:database table $label:table over the last minute
139
+ info: average TOAST hit ratio in db ${label:database} table ${label:table} over the last minute
140
to: dba
141
142
template: postgres_table_toast_index_cache_io_ratio
@@ -152,7 +152,7 @@ component: PostgreSQL
152
warn: $this < (($status >= $WARNING) ? (70) : (60))
153
crit: $this < (($status == $CRITICAL) ? (60) : (50))
154
delay: down 15m multiplier 1.5 max 1h
155
- info: average index TOAST hit ratio in db $label:database table $label:table over the last minute
155
+ info: average index TOAST hit ratio in db ${label:database} table ${label:table} over the last minute
156
to: dba
157
158
template: postgres_table_bloat_size_perc
@@ -167,7 +167,7 @@ component: PostgreSQL
167
warn: $this > (($status >= $WARNING) ? (60) : (70))
168
crit: $this > (($status == $CRITICAL) ? (70) : (80))
169
delay: down 15m multiplier 1.5 max 1h
170
- info: bloat size percentage in db $label:database table $label:table
170
+ info: bloat size percentage in db ${label:database} table ${label:table}
171
to: dba
172
173
template: postgres_table_last_autovacuum_time
@@ -180,7 +180,7 @@ component: PostgreSQL
180
units: seconds
181
every: 1m
182
warn: $this != nan AND $this > (60 * 60 * 24 * 7)
183
- info: time elapsed since db $label:database table $label:table was vacuumed by the autovacuum daemon
183
+ info: time elapsed since db ${label:database} table ${label:table} was vacuumed by the autovacuum daemon
184
to: dba
185
186
template: postgres_table_last_autoanalyze_time
@@ -193,7 +193,7 @@ component: PostgreSQL
193
units: seconds
194
every: 1m
195
warn: $this != nan AND $this > (60 * 60 * 24 * 7)
196
- info: time elapsed since db $label:database table $label:table was analyzed by the autovacuum daemon
196
+ info: time elapsed since db ${label:database} table ${label:table} was analyzed by the autovacuum daemon
197
to: dba
198
199
# Index alarms
@@ -210,5 +210,5 @@ component: PostgreSQL
210
warn: $this > (($status >= $WARNING) ? (60) : (70))
211
crit: $this > (($status == $CRITICAL) ? (70) : (80))
212
delay: down 15m multiplier 1.5 max 1h
213
- info: bloat size percentage in db $label:database table $label:table index $label:index
213
+ info: bloat size percentage in db ${label:database} table ${label:table} index ${label:index}
214
to: dba
health/health.d/zfs.conf
+2
-2
@@ -24,7 +24,7 @@ component: File system
24
every: 10s
25
warn: $this > 0
26
delay: down 1m multiplier 1.5 max 1h
27
- info: ZFS pool $label:pool state is degraded
27
+ info: ZFS pool ${label:pool} state is degraded
28
to: sysadmin
29
30
template: zfs_pool_state_crit
@@ -37,5 +37,5 @@ component: File system
37
every: 10s
38
crit: $this > 0
39
delay: down 1m multiplier 1.5 max 1h
40
- info: ZFS pool $label:pool state is faulted or unavail
40
+ info: ZFS pool ${label:pool} state is faulted or unavail
41
to: sysadmin