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

template_module_smart_agent2_active.yaml « smart_agent2_active « module « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 292c7e7a8e3698b8d1adc70d1829ad986ede6cdb (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
zabbix_export:
  version: '6.0'
  date: '2021-12-16T11:48:11Z'
  groups:
    -
      uuid: 57b7ae836ca64446ba2c296389c009b7
      name: Templates/Modules
  templates:
    -
      uuid: e518b1340ce44d7389d2cc7c304a97b4
      template: 'SMART by Zabbix agent 2 active'
      name: 'SMART by Zabbix agent 2 active'
      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.40
      groups:
        -
          name: Templates/Modules
      items:
        -
          uuid: feba508d76b845039b434f62d9e62d54
          name: 'SMART: Get attributes'
          type: ZABBIX_ACTIVE
          key: smart.disk.get
          history: '0'
          trends: '0'
          value_type: TEXT
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
      discovery_rules:
        -
          uuid: 3b19696e4d8f4f98acb40481adfa7513
          name: 'Attribute discovery'
          type: ZABBIX_ACTIVE
          key: smart.attribute.discovery
          delay: 1h
          description: 'Discovery SMART Vendor Specific Attributes of disks.'
          item_prototypes:
            -
              uuid: 5c09ba32ad72321bce5042d5f4dc59d2
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
            -
              uuid: 498a4f1b4b7442b5a38c52400646cc47
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
              trigger_prototypes:
                -
                  uuid: 26a3e4a0b79340b1bb753ec23c07c79b
                  expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.error[{#NAME},{#ID}]) <= {#THRESH}'
                  name: 'SMART [{#NAME}]: Attribute {#ID} {#ATTRNAME} is failed'
                  priority: WARNING
                  description: 'The value should be greater than THRESH.'
          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: 0a56a348d4a446938beae1eae5ec8993
          name: 'Disk discovery'
          type: ZABBIX_ACTIVE
          key: smart.disk.discovery
          delay: 1h
          description: 'Discovery SMART disks.'
          item_prototypes:
            -
              uuid: ad6a9f6f7293495c916bb0aac0bc9729
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
            -
              uuid: e5bbd606e330469389bf081588b88d17
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
            -
              uuid: 0861b008b09a41799978e085625aaa4a
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
            -
              uuid: f48fe3366b194eb4942411cc776c8633
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
            -
              uuid: d5cef21c49994c3e8e12ef6471d7cdcd
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
              trigger_prototypes:
                -
                  uuid: 68f373252bee4f9e8f3b33d04fc1adbd
                  expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.percentage_used[{#NAME}])>90'
                  name: 'SMART [{#NAME}]: NVMe disk percentage using is over 90% of estimated endurance'
                  priority: AVERAGE
            -
              uuid: 189d8e8d16ed40229ba3ca52b75d2dc4
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
              trigger_prototypes:
                -
                  uuid: 2d5cf100fe094c819d725ee598d37de8
                  expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.sn[{#NAME}],#1)<>last(/SMART by Zabbix agent 2 active/smart.disk.sn[{#NAME}],#2) and length(last(/SMART by Zabbix agent 2 active/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'
            -
              uuid: e79eaaf7ee0d40e7b91fc019f5edb19e
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
              trigger_prototypes:
                -
                  uuid: 7f46b24934854866849dd758cb5999d5
                  expression: 'avg(/SMART by Zabbix agent 2 active/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
                -
                  uuid: c903a37f4b004e1593ef85ac893c3f6c
                  expression: 'avg(/SMART by Zabbix agent 2 active/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 active/smart.disk.temperature[{#NAME}],5m)>{$SMART.TEMPERATURE.MAX.CRIT}'
            -
              uuid: 2475415cc95b4103b2933f921e62dd36
              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: Application
                  value: '{#DISKTYPE} {#NAME}'
              trigger_prototypes:
                -
                  uuid: 304bd042b7644a31bb74a1e71808d196
                  expression: 'last(/SMART by Zabbix agent 2 active/smart.disk.test[{#NAME}])="false"'
                  name: 'SMART [{#NAME}]: Disk self-test is not passed'
                  priority: HIGH
          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.'