-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathZabbix_ACM.yaml
257 lines (251 loc) · 8.31 KB
/
Zabbix_ACM.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
zabbix_export:
version: '5.2'
date: '2021-02-03T10:41:46Z'
groups:
-
name: Templates
templates:
-
template: 'Application Component Monitoring'
name: 'Application Component Monitoring'
description: |
Queries an endpoint to retrieve the available health checks and its statuses.
Documentation: https://github.com/CloudRight/Zabbix-ACM
Issues: https://github.com/CloudRight/Zabbix-ACM/issues
groups:
-
name: Templates
applications:
-
name: 'Application Component Monitoring'
-
name: 'Application Components'
items:
-
name: 'Get Application Component Statuses'
type: HTTP_AGENT
key: acm.status
delay: '{$ACM_INTERVAL}'
history: '0'
trends: '0'
value_type: TEXT
authtype: BASIC
username: '{$ACM_HTTP_USER}'
password: '{$ACM_HTTP_PASS}'
description: 'Retrieves JSON feed of components and their statuses. Used as Dependent Item by discovered items.'
applications:
-
name: 'Application Component Monitoring'
timeout: 30s
url: '{$ACM_URL}'
headers:
-
name: Accept
value: application/json
discovery_rules:
-
name: 'Application Components'
type: DEPENDENT
key: acm.discovery
delay: '0'
lifetime: '{$ACM_DISCOVERY_KEEP_PERIOD}'
description: |
Discovers application components listed in the JSON feed.
Discovered items will be kept for a period of "{$ACM_DISCOVERY_KEEP_PERIOD}" which can be configured in the Host Macro's. Defaults to 0, which means items no longer in the JSON output will be removed from Zabbix.
item_prototypes:
-
name: 'Application Component Status - {#NAME}'
type: DEPENDENT
key: 'acm.status[{#KEY}]'
delay: '0'
description: 'Monitoring of auto-discovered application component {#NAME} with severity {#SEVERITY}. Retrieves the status from the Parent item'
applications:
-
name: 'Application Components'
valuemap:
name: 'Application Component Monitoring'
preprocessing:
-
type: JSONPATH
parameters:
- '$.[''{#KEY}''].status'
error_handler: CUSTOM_ERROR
error_handler_params: 'Unable to retrieve status for {#NAME}.'
master_item:
key: acm.status
trigger_prototypes:
-
expression: '{last()}>0'
name: 'Application component {#NAME} is in {ITEM.VALUE} state on {HOSTNAME}'
description: 'Triggers then the item goes to a state other than "OK" (0).'
manual_close: 'YES'
graph_prototypes:
-
name: 'Application Component Status - {#NAME}'
width: '400'
yaxismax: '2'
ymin_type_1: FIXED
ymax_type_1: FIXED
graph_items:
-
sortorder: '1'
drawtype: FILLED_REGION
color: FF0000
calc_fnc: MAX
item:
host: 'Application Component Monitoring'
key: 'acm.status[{#KEY}]'
master_item:
key: acm.status
preprocessing:
-
type: JAVASCRIPT
parameters:
- |
var components = JSON.parse(value);
var lld = [];
for (var key in components) {
var value = components[key];
var row = {};
row["{#KEY}"] = key;
row["{#NAME}"] = value.name;
row["{#SEVERITY}"] = value.severity;
lld.push(row);
}
return JSON.stringify(lld);
overrides:
-
name: 'Set Trigger Severity to Information'
step: '1'
filter:
conditions:
-
macro: '{#SEVERITY}'
value: ^information$
formulaid: A
operations:
-
operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: 'Application component'
severity: INFO
-
name: 'Set Trigger Severity to Warning'
step: '2'
filter:
conditions:
-
macro: '{#SEVERITY}'
value: ^warning$
formulaid: A
operations:
-
operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: 'Application component'
severity: WARNING
-
name: 'Set Trigger Severity to Average'
step: '3'
filter:
conditions:
-
macro: '{#SEVERITY}'
value: ^average$
formulaid: A
operations:
-
operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: 'Application component'
severity: AVERAGE
-
name: 'Set Trigger Severity to High'
step: '4'
filter:
conditions:
-
macro: '{#SEVERITY}'
value: ^high$
formulaid: A
operations:
-
operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: 'Application component'
severity: HIGH
-
name: 'Set Trigger Severity to Disaster'
step: '5'
filter:
conditions:
-
macro: '{#SEVERITY}'
value: ^disaster$
formulaid: A
operations:
-
operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: 'Application component'
severity: DISASTER
macros:
-
macro: '{$ACM_DISCOVERY_KEEP_PERIOD}'
value: '0'
description: 'Amount of time to keep items that are no longer part of the discovery result.'
-
macro: '{$ACM_HTTP_PASS}'
description: '(Optional) password to use to query the endpoints'
-
macro: '{$ACM_HTTP_USER}'
description: '(Optional) username to use to query the endpoints'
-
macro: '{$ACM_INTERVAL}'
value: 2m
description: 'Update interval for retrieving the component statuses'
-
macro: '{$ACM_URL}'
value: '{HOSTNAME}/acm/status'
description: 'URL to use to retrieve component services with'
dashboards:
-
name: 'Application Component Status'
widgets:
-
type: GRAPH_PROTOTYPE
width: '23'
height: '12'
hide_header: 'YES'
fields:
-
type: INTEGER
name: show_legend
value: '0'
-
type: INTEGER
name: rows
value: '2'
-
type: INTEGER
name: columns
value: '3'
-
type: GRAPH_PROTOTYPE
name: graphid
value:
name: 'Application Component Status - {#NAME}'
host: 'Application Component Monitoring'
value_maps:
-
name: 'Application Component Monitoring'
mappings:
-
value: '0'
newvalue: OK
-
value: '1'
newvalue: Degraded
-
value: '2'
newvalue: Problem