-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathZabbix_ACM.yaml
220 lines (214 loc) · 8.24 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
zabbix_export:
version: "5.4"
date: "2021-10-19T13:54:22Z"
groups:
- uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
templates:
- uuid: f58ec53ac6374256a95bf9572481d166
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
items:
- uuid: 926b9a1e5a6f4ee4a9600584468d2a91
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."
timeout: 30s
url: "{$ACM_URL}"
headers:
- name: Accept
value: application/json
tags:
- tag: Application
value: "Application Component Monitoring"
discovery_rules:
- uuid: 50f92938f7e84b7f8c2514313f369462
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:
- uuid: 7c57730eb1a846b8babf68c72f851acc
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"
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
tags:
- tag: Application
value: "Application Components"
trigger_prototypes:
- uuid: 9c35afddd3f14c668ada61428c713cf4
expression: "last(/Application Component Monitoring/acm.status[{#KEY}])>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:
- uuid: 207b245501c741fcb49a7e61ec725b98
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 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 Disaster"
step: "5"
filter:
conditions:
- macro: "{#SEVERITY}"
value: ^disaster$
formulaid: A
operations:
- operationobject: TRIGGER_PROTOTYPE
operator: LIKE
value: "Application component"
severity: DISASTER
- 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 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
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:
- uuid: 1e75cec0f40a48738b28fe074d3149e5
name: "Application Component Status"
pages:
- 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"
valuemaps:
- uuid: 2fbe30a013c54052953ad51df0ab23f8
name: "Application Component Monitoring"
mappings:
- value: "0"
newvalue: OK
- value: "1"
newvalue: Degraded
- value: "2"
newvalue: Problem