Welcome to mirror list, hosted at ThFree Co, Russian Federation.

template_module_smart_agent2.yaml « smart_agent2 « module « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 178bcdca14cf4d37534f4da3100580ff388f7b9e (plain)
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
zabbix_export:
  version: '6.0'
  date: '2022-01-26T10:32:37Z'
  groups:
    -
      uuid: 57b7ae836ca64446ba2c296389c009b7
      name: Templates/Modules
  templates:
    -
      uuid: 7b6c6228b25f4586b42cd1bf37ff8034
      template: 'SMART by Zabbix agent 2'
      name: 'SMART by Zabbix agent 2'
      description: |
        The template for monitoring S.M.A.R.T. attributes of physical disk that works without any external scripts. It collects metrics by Zabbix agent 2 version 5.0 and later with Smartmontools version 7.1 and later. Disk discovery LLD rule finds all HDD, SSD, NVMe disks with S.M.A.R.T. enabled. Attribute discovery LLD rule finds all Vendor Specific Attributes for each disk. If you want to skip some attributes, please set regular expressions with disk names in {$SMART.DISK.NAME.MATCHES} and with attribute IDs in {$SMART.ATTRIBUTE.ID.MATCHES} macros on the host level.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/415662-discussion-thread-for-official-zabbix-smart-disk-monitoring
        
        Template tooling version used: 0.41
      groups:
        -
          name: Templates/Modules
      items:
        -
          uuid: 2e5275a0b4174632ace850cdf6586cb9
          name: 'SMART: Get attributes'
          key: smart.disk.get
          history: '0'
          trends: '0'
          value_type: TEXT
          tags:
            -
              tag: component
              value: raw
            -
              tag: component
              value: storage
      discovery_rules:
        -
          uuid: c5aede547c19434c90f72e43276fe1d7
          name: 'Attribute discovery'
          key: smart.attribute.discovery
          delay: 1h
          description: 'Discovery SMART Vendor Specific Attributes of disks.'
          item_prototypes:
            -
              uuid: 04718ade5247478da0450f1cd497b782
              name: 'SMART [{#NAME}]: ID {#ID} {#ATTRNAME} raw value'
              type: DEPENDENT
              key: 'smart.disk.attr.raw[{#NAME},{#ID}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].ata_smart_attributes.table[?(@.id=={#ID})].raw.string.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
            -
              uuid: 2af3d630a99a4989b94e2afd782a3f78
              name: 'SMART [{#NAME}]: ID {#ID} {#ATTRNAME}'
              type: DEPENDENT
              key: 'smart.disk.error[{#NAME},{#ID}]'
              delay: '0'
              history: 7d
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].ata_smart_attributes.table[?(@.id=={#ID})].value.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                -
                  uuid: 686066892ab94b86a97ba1902d361f97
                  expression: 'last(/SMART by Zabbix agent 2/smart.disk.error[{#NAME},{#ID}]) <= {#THRESH}'
                  name: 'SMART [{#NAME}]: Attribute {#ID} {#ATTRNAME} is failed'
                  priority: WARNING
                  description: 'The value should be greater than THRESH.'
                  tags:
                    -
                      tag: scope
                      value: notice
          overrides:
            -
              name: 'ID filter'
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#ID}'
                    value: '{$SMART.ATTRIBUTE.ID.MATCHES}'
                    formulaid: A
                  -
                    macro: '{#NAME}'
                    value: '{$SMART.DISK.NAME.MATCHES}'
                    formulaid: B
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: REGEXP
                  status: ENABLED
                  discover: NO_DISCOVER
        -
          uuid: 4575af2717ec4bf78645edb84a966c84
          name: 'Disk discovery'
          key: smart.disk.discovery
          delay: 1h
          description: 'Discovery SMART disks.'
          item_prototypes:
            -
              uuid: c186f7ce1b8d4311997c84fd5c239819
              name: 'SMART [{#NAME}]: Critical warning'
              type: DEPENDENT
              key: 'smart.disk.critical_warning[{#NAME}]'
              delay: '0'
              history: 7d
              description: 'This field indicates critical warnings for the state of the controller.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.critical_warning.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
            -
              uuid: 365f9642f2764116923bb3e014eefa22
              name: 'SMART [{#NAME}]: Power on hours'
              type: DEPENDENT
              key: 'smart.disk.hours[{#NAME}]'
              delay: '0'
              history: 7d
              description: 'Count of hours in power-on state. The raw value of this attribute shows total count of hours (or minutes, or seconds, depending on manufacturer) in power-on state. "By default, the total expected lifetime of a hard disk in perfect condition is defined as 5 years (running every day and night on all days). This is equal to 1825 days in 24/7 mode or 43800 hours." On some pre-2005 drives, this raw value may advance erratically and/or "wrap around" (reset to zero periodically). https://en.wikipedia.org/wiki/S.M.A.R.T.#Known_ATA_S.M.A.R.T._attributes'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].power_on_time.hours.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
            -
              uuid: 8478d6421fb044339e2118848ac6d56b
              name: 'SMART [{#NAME}]: Media errors'
              type: DEPENDENT
              key: 'smart.disk.media_errors[{#NAME}]'
              delay: '0'
              history: 7d
              description: 'Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.media_errors.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
            -
              uuid: b6abf9b52c694600b63fce4a68fc0fbd
              name: 'SMART [{#NAME}]: Device model'
              type: DEPENDENT
              key: 'smart.disk.model[{#NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].model_name.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: inventory
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
            -
              uuid: 6ce46d274a694eac9700bd02a936f4be
              name: 'SMART [{#NAME}]: Percentage used'
              type: DEPENDENT
              key: 'smart.disk.percentage_used[{#NAME}]'
              delay: '0'
              history: 7d
              units: '%'
              description: 'Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturer''s prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].nvme_smart_health_information_log.percentage_used.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: storage
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                -
                  uuid: e2bc2b0e195446d7973037be8e41eb6f
                  expression: 'last(/SMART by Zabbix agent 2/smart.disk.percentage_used[{#NAME}])>90'
                  name: 'SMART [{#NAME}]: NVMe disk percentage using is over 90% of estimated endurance'
                  priority: AVERAGE
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 62f98419c8034f389a5be3755eac8938
              name: 'SMART [{#NAME}]: Serial number'
              type: DEPENDENT
              key: 'smart.disk.sn[{#NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].serial_number.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: inventory
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                -
                  uuid: 7257c02f398f4338ace1eb3a07cb7362
                  expression: 'last(/SMART by Zabbix agent 2/smart.disk.sn[{#NAME}],#1)<>last(/SMART by Zabbix agent 2/smart.disk.sn[{#NAME}],#2) and length(last(/SMART by Zabbix agent 2/smart.disk.sn[{#NAME}]))>0'
                  name: 'SMART [{#NAME}]: Disk has been replaced (new serial number received)'
                  priority: INFO
                  description: 'Device serial number has changed. Ack to close.'
                  manual_close: 'YES'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 2f5b054d7a644e029a195d17f525c191
              name: 'SMART [{#NAME}]: Temperature'
              type: DEPENDENT
              key: 'smart.disk.temperature[{#NAME}]'
              delay: '0'
              history: 7d
              units: °C
              description: 'Current drive temperature.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].temperature.current.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: temperature
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                -
                  uuid: cd09aebe3ca146119cdf5b977bf6b018
                  expression: 'avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT}'
                  name: 'SMART [{#NAME}]: Average disk temperature is critical (over {$SMART.TEMPERATURE.MAX.CRIT}°C for 5m)'
                  priority: AVERAGE
                  tags:
                    -
                      tag: scope
                      value: notice
                -
                  uuid: aaa5acb3196b481f894998c0ca5ea165
                  expression: 'avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.WARN}'
                  name: 'SMART [{#NAME}]: Average disk temperature is too high (over {$SMART.TEMPERATURE.MAX.WARN}°C for 5m)'
                  priority: WARNING
                  dependencies:
                    -
                      name: 'SMART [{#NAME}]: Average disk temperature is critical (over {$SMART.TEMPERATURE.MAX.CRIT}°C for 5m)'
                      expression: 'avg(/SMART by Zabbix agent 2/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT}'
                  tags:
                    -
                      tag: scope
                      value: notice
            -
              uuid: 434b338d88e041dd9b6a0b7aaa403076
              name: 'SMART [{#NAME}]: Self-test passed'
              type: DEPENDENT
              key: 'smart.disk.test[{#NAME}]'
              delay: '0'
              history: 7d
              trends: '0'
              value_type: CHAR
              description: 'The disk is passed the SMART self-test or not.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$[?(@.disk_name==''{#NAME}'')].ata_smart_data.self_test.status.passed.first()'
                -
                  type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: smart.disk.get
              tags:
                -
                  tag: component
                  value: health
                -
                  tag: diskname
                  value: '{#NAME}'
                -
                  tag: disktype
                  value: '{#DISKTYPE}'
              trigger_prototypes:
                -
                  uuid: 5fa97df4012e45279fb55724f617ef4a
                  expression: 'last(/SMART by Zabbix agent 2/smart.disk.test[{#NAME}])="false"'
                  name: 'SMART [{#NAME}]: Disk self-test is not passed'
                  priority: HIGH
                  tags:
                    -
                      tag: scope
                      value: notice
          overrides:
            -
              name: 'Not NVMe'
              step: '2'
              filter:
                conditions:
                  -
                    macro: '{#DISKTYPE}'
                    value: nvme
                    operator: NOT_MATCHES_REGEX
                    formulaid: A
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: REGEXP
                  value: Media|Percentage|Critical
                  status: ENABLED
                  discover: NO_DISCOVER
            -
              name: Self-test
              step: '1'
              filter:
                conditions:
                  -
                    macro: '{#DISKTYPE}'
                    value: nvme
                    formulaid: A
              operations:
                -
                  operationobject: ITEM_PROTOTYPE
                  operator: LIKE
                  value: Self-test
                  status: ENABLED
                  discover: NO_DISCOVER
      macros:
        -
          macro: '{$SMART.ATTRIBUTE.ID.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.'
        -
          macro: '{$SMART.DISK.NAME.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in overrides of attribute discovery for filtering IDs. It can be overridden on the host or linked template level.'
        -
          macro: '{$SMART.TEMPERATURE.MAX.CRIT}'
          value: '65'
          description: 'This macro is used for trigger expression. It can be overridden on the host or linked template level.'
        -
          macro: '{$SMART.TEMPERATURE.MAX.WARN}'
          value: '50'
          description: 'This macro is used for trigger expression. It can be overridden on the host or linked template level.'