-
Notifications
You must be signed in to change notification settings - Fork 0
/
Template XCP-NG 8.2.yaml
428 lines (428 loc) · 14.6 KB
/
Template XCP-NG 8.2.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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
zabbix_export:
version: '6.4'
template_groups:
- uuid: 7df96b18c230490a9a0a9e2307226338
name: Templates
- uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
name: Templates/Applications
host_groups:
- uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
name: Templates/Applications
templates:
- uuid: e03aecea0a694e65b6daa4646dcfedeb
template: 'Template XCP-NG 8.2'
name: 'Template XCP-NG 8.2'
description: |
Author: Guille Rodriguez
Website: https://github.com/guillerg86
groups:
- name: Templates
discovery_rules:
- uuid: 93ccb2c13ee34745bbd01591df55e6e2
name: 'Discover VMs'
key: xcpng.vms.discovery
delay: 20m
lifetime: 1h
host_prototypes:
- uuid: f092540d117e41dd8ff13b0d4286375d
host: '{#VM.UUID}'
name: '{#VM.NAME} VM'
group_links:
- group:
name: Templates/Applications
templates:
- name: 'Template XCP-NG 8.2 Guest VM'
preprocessing:
- type: JSONPATH
parameters:
- $.vmlist
- uuid: e0019a6bb16a48708d49320a4115c4e1
template: 'Template XCP-NG 8.2 Guest VM'
name: 'Template XCP-NG 8.2 Guest VM'
description: |
Author: Guille Rodriguez
Website: https://github.com/guillerg86
groups:
- name: Templates/Applications
items:
- uuid: 204eeb42b0f44cff90b86ff7a6eff99a
name: 'Auto poweron'
key: 'xcpng.vms.details[{HOST.HOST},"auto-poweron"]'
delay: 1h
history: 7d
description: 'Check if autopoweron is configured on VM'
valuemap:
name: 'VM Enabled Disabled'
preprocessing:
- type: JAVASCRIPT
parameters:
- |
var newvalue;
switch(value) {
case "false":
newvalue = 0;
break;
case "true":
newvalue = 1;
break;
default:
newvalue = value;
}
return newvalue;
tags:
- tag: Application
value: XCP-NG
- uuid: 81a30c3d0f4445b782422653e8ecf0ee
name: HVM
key: 'xcpng.vms.details[{HOST.HOST},"hvm"]'
delay: 10m
history: 7d
description: 'Virtualization Mode (HVM, PV)'
valuemap:
name: 'VM Enabled Disabled'
preprocessing:
- type: JAVASCRIPT
parameters:
- |
var newvalue;
switch(value) {
case "false":
newvalue = 0;
break;
case "true":
newvalue = 1;
break;
default:
newvalue = value;
}
return newvalue;
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 88515e9a058949c9b136fc23b26946bf
name: 'Memory actual'
key: 'xcpng.vms.details[{HOST.HOST},"memory-actual"]'
history: 7d
units: B
tags:
- tag: Application
value: XCP-NG
- uuid: 9af0005cdd2d47d293189ebea835a908
name: 'Memory dynamic max'
key: 'xcpng.vms.details[{HOST.HOST},"memory-dynamic-max"]'
delay: 10m
history: 7d
units: B
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 761ddee5eecd464daa9d93e2827f9d14
name: 'Memory dynamic min'
key: 'xcpng.vms.details[{HOST.HOST},"memory-dynamic-min"]'
delay: 10m
history: 7d
units: B
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 3569b16112b04496933f211159d2b0ca
name: 'Memory overhead'
key: 'xcpng.vms.details[{HOST.HOST},"memory-overhead"]'
history: 7d
units: B
tags:
- tag: Application
value: XCP-NG
- uuid: 064ecc8f4efb4fb18a6b85f6c926ab5c
name: 'Memory static max'
key: 'xcpng.vms.details[{HOST.HOST},"memory-static-max"]'
delay: 10m
history: 7d
units: B
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 10156f499c7d47bd9d9f6c771f00a9ad
name: 'Memory static min'
key: 'xcpng.vms.details[{HOST.HOST},"memory-static-min"]'
delay: 10m
history: 7d
units: B
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 306661cdb4ac4a9580e75718764e27b3
name: 'Memory target'
key: 'xcpng.vms.details[{HOST.HOST},"memory-target"]'
delay: 10m
history: 7d
units: B
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 6bdccf21936c44a8989c3734e5b2dbbf
name: 'Power state'
key: 'xcpng.vms.details[{HOST.HOST},"power-state"]'
history: 7d
description: 'The current power state of the virtual machine.'
valuemap:
name: VirtualMachinePowerState
preprocessing:
- type: JAVASCRIPT
parameters:
- |
var newvalue;
switch(value) {
case "halted":
newvalue = 0;
break;
case "running":
newvalue = 1;
break;
case "suspended":
newvalue = 2;
break;
case "paused":
newvalue = 3;
break;
default:
newvalue = value;
}
return newvalue;
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: a3c55fdadc524a62abc2ca33f3e63c94
name: 'Requires reboot'
key: 'xcpng.vms.details[{HOST.HOST},"requires-reboot"]'
delay: 10m
history: 7d
description: 'Check if VM requires a reboot via XCP-ng'
valuemap:
name: 'VM yes no'
preprocessing:
- type: JAVASCRIPT
parameters:
- |
var newvalue;
switch(value) {
case "false":
newvalue = 0;
break;
case "true":
newvalue = 1;
break;
default:
newvalue = value;
}
return newvalue;
tags:
- tag: Application
value: XCP-NG
triggers:
- uuid: 3928c4c3833140de8482275c613f57af
expression: 'last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"requires-reboot"])=1'
name: 'VM requires reboot'
priority: INFO
description: 'Hypervisor has flagged this VM as requires reboot'
manual_close: 'YES'
- uuid: 7f82a124efa44a62b209defd32a0b76b
name: Start-time
key: 'xcpng.vms.details[{HOST.HOST},"start-time"]'
delay: 10m
history: 7d
value_type: FLOAT
units: unixtime
description: 'Datetime when VM was poweredon'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 6ad118f2e8354aba81ffb80da5d6dc2c
name: Uptime
key: 'xcpng.vms.details[{HOST.HOST},"uptime"]'
delay: 3m
history: 7d
value_type: FLOAT
units: s
description: 'Time since VM was poweredon'
tags:
- tag: Application
value: XCP-NG
triggers:
- uuid: 9e8477cec959439887ed89600b50fc2c
expression: 'last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"uptime"])>5s and last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"uptime"])<10m'
name: 'VM has been restarted (uptime < 10m)'
priority: WARNING
- uuid: 884ee37ca90d44f3a2cdac14a3483304
name: 'Number of virtual CPUs'
key: 'xcpng.vms.details[{HOST.HOST},"VCPUs-number"]'
delay: 10m
history: 7d
description: 'Number of Virtual CPUs'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 1h
tags:
- tag: Application
value: XCP-NG
- uuid: 2f14948041fd496eb959f5964ce65247
name: 'CPU Usage'
key: 'xcpng.vms.details[{HOST.HOST},"VCPUs-utilisation"]'
history: 7d
value_type: FLOAT
description: 'Usage of CPU'
preprocessing:
- type: DISCARD_UNCHANGED_HEARTBEAT
parameters:
- 30m
tags:
- tag: Application
value: XCP-NG
discovery_rules:
- uuid: 5dfc20cca5c545529a674de175c372af
name: 'Network device discovery'
key: 'xcpng.vms.vif.discovery[{HOST.HOST}]'
delay: 1h
lifetime: 2h
description: 'Discovery of all network devices.'
item_prototypes:
- uuid: 98e18cb04cb74db09ba42d03e5ab7ba2
name: 'VIF {#VM.VIF.UUID}: KBytes received'
key: 'xcpng.vms.vif.details[{#VM.VIF.UUID},"vif-kbytes-rcvd"]'
history: 7d
value_type: FLOAT
units: K
tags:
- tag: Application
value: Network
- tag: Network
value: '{#VM.VIF.UUID}'
- uuid: c33d0915dd034b1ba4251fa4b2155304
name: 'VIF {#VM.VIF.UUID}: KBytes transmitted'
key: 'xcpng.vms.vif.details[{#VM.VIF.UUID},"vif-kbytes-sent"]'
history: 7d
value_type: FLOAT
units: K
description: 'Interface MAC Address'
tags:
- tag: Application
value: Network
- tag: Network
value: '{#VM.VIF.UUID}'
- uuid: ab0ff852407143d384d46d2a0c6675da
name: 'VIF {#VM.VIF.UUID}: MAC'
key: 'xcpng.vms.vif.details[{#VM.VIF.UUID},"vif-mac-addr"]'
delay: 1h
history: 7d
trends: '0'
value_type: CHAR
description: 'Interface MAC Address'
tags:
- tag: Application
value: Network
- tag: Network
value: '{#VM.VIF.UUID}'
- uuid: 7d80b0c79abb4b69b556ff6d38e88f4f
name: 'VIF {#VM.VIF.UUID}: MTU'
key: 'xcpng.vms.vif.details[{#VM.VIF.UUID},"vif-mtu"]'
delay: 1h
history: 7d
trends: '0'
value_type: CHAR
description: 'Interface MTU'
tags:
- tag: Application
value: Network
- tag: Network
value: '{#VM.VIF.UUID}'
- uuid: 9cf9897489ff4a1a9e7cb24a32c98066
name: 'VIF {#VM.VIF.UUID}: Network / Vlan Name'
key: 'xcpng.vms.vif.details[{#VM.VIF.UUID},"vif-network-name"]'
delay: 1h
history: 7d
trends: '0'
value_type: CHAR
description: 'Network name or VLAN name where Interface is connected.'
tags:
- tag: Application
value: Network
- tag: Network
value: '{#VM.VIF.UUID}'
preprocessing:
- type: JSONPATH
parameters:
- $.vif_list
valuemaps:
- uuid: 519df291854946dfa679a58d2ed3c00a
name: VirtualMachinePowerState
mappings:
- value: '0'
newvalue: poweredOff
- value: '1'
newvalue: poweredOn
- value: '2'
newvalue: suspended
- uuid: 9fa7cce0a0a940079ad376f0698040cf
name: 'VM Enabled Disabled'
mappings:
- value: '0'
newvalue: disabled
- value: '1'
newvalue: enabled
- uuid: 259df6dd2b66433493ae25247699a27a
name: 'VM yes no'
mappings:
- value: '0'
newvalue: 'no'
- value: '1'
newvalue: 'yes'
triggers:
- uuid: 16de107735b2441e97184245a91587d2
expression: 'last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"power-state"])=3 and last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"auto-poweron"])=1'
name: 'VM is paused'
priority: HIGH
description: 'VM is powered off but auto poweron is enabled'
manual_close: 'YES'
- uuid: bf56ae37cb7d4b7682548eee9083c3e6
expression: 'last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"power-state"])=0 and last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"auto-poweron"])=1'
name: 'VM is powered off'
priority: HIGH
description: 'VM is powered off but auto poweron is enabled'
manual_close: 'YES'
- uuid: d4b28ac9ce0547c4afa7c346d6264de1
expression: 'last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"power-state"])=2 and last(/Template XCP-NG 8.2 Guest VM/xcpng.vms.details[{HOST.HOST},"auto-poweron"])=1'
name: 'VM is suspended'
priority: HIGH
description: 'VM is powered off but auto poweron is enabled'
manual_close: 'YES'