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

template_module_host_resources_snmp.yaml « host_resources_snmp « module « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15c525446d628c0cc61258709e8fc5dc2ed7be39 (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
zabbix_export:
  version: '5.2'
  date: '2020-10-16T09:33:25Z'
  groups:
    -
      name: Templates/Modules
  templates:
    -
      template: 'HOST-RESOURCES-MIB CPU SNMP'
      name: 'HOST-RESOURCES-MIB CPU SNMP'
      description: |
        Requires Zabbix server 4.0.14, 4.2.8, 4.4.0 or newer (JSONPath function avg() used with types autoconversion).
        
        MIBs used:
        HOST-RESOURCES-MIB
        
        Template tooling version used: 0.38
      groups:
        -
          name: Templates/Modules
      applications:
        -
          name: CPU
      items:
        -
          name: 'CPU utilization'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#CPU.UTIL},1.3.6.1.2.1.25.3.3.1.2]'
          key: system.cpu.util
          history: 7d
          value_type: FLOAT
          units: '%'
          description: |
            MIB: HOST-RESOURCES-MIB
            The average, over the last minute, of the percentage of time that processors was not idle.
            Implementations may approximate this one minute smoothing period if necessary.
          applications:
            -
              name: CPU
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$..[''{#CPU.UTIL}''].avg()'
          triggers:
            -
              expression: '{min(5m)}>{$CPU.UTIL.CRIT}'
              name: 'High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m)'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'CPU utilization is too high. The system might be slow to respond.'
      macros:
        -
          macro: '{$CPU.UTIL.CRIT}'
          value: '90'
    -
      template: 'HOST-RESOURCES-MIB memory SNMP'
      name: 'HOST-RESOURCES-MIB memory SNMP'
      description: |
        MIBs used:
        HOST-RESOURCES-MIB
        
        Template tooling version used: 0.38
      groups:
        -
          name: Templates/Modules
      applications:
        -
          name: Memory
      discovery_rules:
        -
          name: 'Memory discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#MEMNAME},1.3.6.1.2.1.25.2.3.1.3,{#MEMTYPE},1.3.6.1.2.1.25.2.3.1.2,{#ALLOC_UNITS},1.3.6.1.2.1.25.2.3.1.4]'
          key: vm.memory.discovery
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#MEMTYPE}'
                value: '{$MEMORY.TYPE.MATCHES}'
                formulaid: C
              -
                macro: '{#MEMTYPE}'
                value: '{$MEMORY.TYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: D
              -
                macro: '{#MEMNAME}'
                value: '{$MEMORY.NAME.MATCHES}'
                formulaid: A
              -
                macro: '{#MEMNAME}'
                value: '{$MEMORY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: B
          description: 'HOST-RESOURCES-MIB::hrStorage discovery with memory filter'
          item_prototypes:
            -
              name: '{#MEMNAME}: Total memory'
              type: SNMP_AGENT
              snmp_oid: '1.3.6.1.2.1.25.2.3.1.5.{#SNMPINDEX}'
              key: 'vm.memory.total[hrStorageSize.{#SNMPINDEX}]'
              history: 7d
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                The size of the storage represented by this entry, in units of hrStorageAllocationUnits.
                This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.
                For example, the amount of main memory allocated to a buffer pool might be modified or the amount of disk space allocated to virtual memory might be modified.
              applications:
                -
                  name: Memory
              preprocessing:
                -
                  type: MULTIPLIER
                  parameters:
                    - '{#ALLOC_UNITS}'
            -
              name: '{#MEMNAME}: Used memory'
              type: SNMP_AGENT
              snmp_oid: '1.3.6.1.2.1.25.2.3.1.6.{#SNMPINDEX}'
              key: 'vm.memory.used[hrStorageUsed.{#SNMPINDEX}]'
              history: 7d
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.
              applications:
                -
                  name: Memory
              preprocessing:
                -
                  type: MULTIPLIER
                  parameters:
                    - '{#ALLOC_UNITS}'
            -
              name: '{#MEMNAME}: Memory utilization'
              type: CALCULATED
              key: 'vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]'
              history: 7d
              value_type: FLOAT
              units: '%'
              params: 'last("vm.memory.used[hrStorageUsed.{#SNMPINDEX}]")/last("vm.memory.total[hrStorageSize.{#SNMPINDEX}]")*100'
              description: 'Memory utilization in %'
              applications:
                -
                  name: Memory
              trigger_prototypes:
                -
                  expression: '{min(5m)}>{$MEMORY.UTIL.MAX}'
                  name: '{#MEMNAME}: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)'
                  priority: AVERAGE
                  description: 'The system is running out of free memory.'
          graph_prototypes:
            -
              name: '{#MEMNAME}: Memory utilization'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'HOST-RESOURCES-MIB memory SNMP'
                    key: 'vm.memory.util[memoryUsedPercentage.{#SNMPINDEX}]'
      macros:
        -
          macro: '{$MEMORY.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in memory discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$MEMORY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in memory discovery. Can be overridden on the host or linked template level if you need to filter out results.'
        -
          macro: '{$MEMORY.TYPE.MATCHES}'
          value: '.*(\.2|hrStorageRam)$'
          description: 'This macro is used in memory discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$MEMORY.TYPE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in memory discovery. Can be overridden on the host or linked template level if you need to filter out results.'
        -
          macro: '{$MEMORY.UTIL.MAX}'
          value: '90'
          description: 'The warning threshold of the "Physical memory: Memory utilization" item.'
    -
      template: 'HOST-RESOURCES-MIB SNMP'
      name: 'HOST-RESOURCES-MIB SNMP'
      description: |
        HOST-RESOURCES-MIB: CPU, memory and storage(vfs.fs.file) linked together.
        
        Template tooling version used: 0.38
      templates:
        -
          name: 'HOST-RESOURCES-MIB CPU SNMP'
        -
          name: 'HOST-RESOURCES-MIB memory SNMP'
        -
          name: 'HOST-RESOURCES-MIB storage SNMP'
      groups:
        -
          name: Templates/Modules
      dashboards:
        -
          name: 'System performance'
          widgets:
            -
              type: GRAPH_CLASSIC
              width: '24'
              height: '5'
              fields:
                -
                  type: INTEGER
                  name: source_type
                  value: '0'
                -
                  type: GRAPH
                  name: graphid
                  value:
                    name: 'CPU utilization'
                    host: 'HOST-RESOURCES-MIB SNMP'
            -
              type: GRAPH_PROTOTYPE
              'y': '5'
              width: '24'
              height: '5'
              fields:
                -
                  type: INTEGER
                  name: columns
                  value: '1'
                -
                  type: INTEGER
                  name: rows
                  value: '1'
                -
                  type: INTEGER
                  name: source_type
                  value: '2'
                -
                  type: GRAPH_PROTOTYPE
                  name: graphid
                  value:
                    name: '{#MEMNAME}: Memory utilization'
                    host: 'HOST-RESOURCES-MIB SNMP'
            -
              type: GRAPH_PROTOTYPE
              'y': '10'
              width: '24'
              height: '5'
              fields:
                -
                  type: INTEGER
                  name: columns
                  value: '1'
                -
                  type: INTEGER
                  name: rows
                  value: '1'
                -
                  type: INTEGER
                  name: source_type
                  value: '2'
                -
                  type: GRAPH_PROTOTYPE
                  name: graphid
                  value:
                    name: '{#FSNAME}: Disk space usage'
                    host: 'HOST-RESOURCES-MIB SNMP'
    -
      template: 'HOST-RESOURCES-MIB storage SNMP'
      name: 'HOST-RESOURCES-MIB storage SNMP'
      description: |
        MIBs used:
        HOST-RESOURCES-MIB
        
        Template tooling version used: 0.38
      groups:
        -
          name: Templates/Modules
      applications:
        -
          name: Storage
      discovery_rules:
        -
          name: 'Storage discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#FSNAME},1.3.6.1.2.1.25.2.3.1.3,{#FSTYPE},1.3.6.1.2.1.25.2.3.1.2,{#ALLOC_UNITS},1.3.6.1.2.1.25.2.3.1.4]'
          key: 'vfs.fs.discovery[snmp]'
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              -
                macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.MATCHES}'
                formulaid: C
              -
                macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: D
              -
                macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.MATCHES}'
                formulaid: A
              -
                macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: B
          description: 'HOST-RESOURCES-MIB::hrStorage discovery with storage filter.'
          item_prototypes:
            -
              name: '{#FSNAME}: Space utilization'
              type: CALCULATED
              key: 'vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}]'
              history: 7d
              value_type: FLOAT
              units: '%'
              params: '(last("vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]")/last("vfs.fs.total[hrStorageSize.{#SNMPINDEX}]"))*100'
              description: 'Space utilization in % for {#FSNAME}'
              application_prototypes:
                -
                  name: 'Filesystem {#FSNAME}'
            -
              name: '{#FSNAME}: Total space'
              type: SNMP_AGENT
              snmp_oid: '1.3.6.1.2.1.25.2.3.1.5.{#SNMPINDEX}'
              key: 'vfs.fs.total[hrStorageSize.{#SNMPINDEX}]'
              history: 7d
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                The size of the storage represented by this entry, in units of hrStorageAllocationUnits.
                This object is writable to allow remote configuration of the size of the storage area in those cases where such an operation makes sense and is possible on the underlying system.
                For example, the amount of main storage allocated to a buffer pool might be modified or the amount of disk space allocated to virtual storage might be modified.
              application_prototypes:
                -
                  name: 'Filesystem {#FSNAME}'
              preprocessing:
                -
                  type: MULTIPLIER
                  parameters:
                    - '{#ALLOC_UNITS}'
            -
              name: '{#FSNAME}: Used space'
              type: SNMP_AGENT
              snmp_oid: '1.3.6.1.2.1.25.2.3.1.6.{#SNMPINDEX}'
              key: 'vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]'
              history: 7d
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                The amount of the storage represented by this entry that is allocated, in units of hrStorageAllocationUnits.
              application_prototypes:
                -
                  name: 'Filesystem {#FSNAME}'
              preprocessing:
                -
                  type: MULTIPLIER
                  parameters:
                    - '{#ALLOC_UNITS}'
          trigger_prototypes:
            -
              expression: |
                {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].last()}>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
                (({HOST-RESOURCES-MIB storage SNMP:vfs.fs.total[hrStorageSize.{#SNMPINDEX}].last()}-{HOST-RESOURCES-MIB storage SNMP:vfs.fs.used[hrStorageUsed.{#SNMPINDEX}].last()})<5G or {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].timeleft(1h,,100)}<1d)
              name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
              opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
              priority: AVERAGE
              description: |
                Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}.
                 Second condition should be one of the following:
                 - The disk free space is less than 5G.
                 - The disk will be full in less than 24 hours.
              manual_close: 'YES'
            -
              expression: |
                {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].last()}>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"} and
                (({HOST-RESOURCES-MIB storage SNMP:vfs.fs.total[hrStorageSize.{#SNMPINDEX}].last()}-{HOST-RESOURCES-MIB storage SNMP:vfs.fs.used[hrStorageUsed.{#SNMPINDEX}].last()})<10G or {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].timeleft(1h,,100)}<1d)
              name: '{#FSNAME}: Disk space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%)'
              opdata: 'Space used: {ITEM.LASTVALUE3} of {ITEM.LASTVALUE2} ({ITEM.LASTVALUE1})'
              priority: WARNING
              description: |
                Two conditions should match: First, space utilization should be above {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}.
                 Second condition should be one of the following:
                 - The disk free space is less than 10G.
                 - The disk will be full in less than 24 hours.
              manual_close: 'YES'
              dependencies:
                -
                  name: '{#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%)'
                  expression: |
                    {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].last()}>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"} and
                    (({HOST-RESOURCES-MIB storage SNMP:vfs.fs.total[hrStorageSize.{#SNMPINDEX}].last()}-{HOST-RESOURCES-MIB storage SNMP:vfs.fs.used[hrStorageUsed.{#SNMPINDEX}].last()})<5G or {HOST-RESOURCES-MIB storage SNMP:vfs.fs.pused[storageUsedPercentage.{#SNMPINDEX}].timeleft(1h,,100)}<1d)
          graph_prototypes:
            -
              name: '{#FSNAME}: Disk space usage'
              width: '600'
              height: '340'
              type: PIE
              show_3d: 'YES'
              graph_items:
                -
                  color: '969696'
                  calc_fnc: LAST
                  type: GRAPH_SUM
                  item:
                    host: 'HOST-RESOURCES-MIB storage SNMP'
                    key: 'vfs.fs.total[hrStorageSize.{#SNMPINDEX}]'
                -
                  sortorder: '1'
                  color: C80000
                  calc_fnc: LAST
                  item:
                    host: 'HOST-RESOURCES-MIB storage SNMP'
                    key: 'vfs.fs.used[hrStorageUsed.{#SNMPINDEX}]'
      macros:
        -
          macro: '{$VFS.FS.FSNAME.MATCHES}'
          value: .+
          description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$VFS.FS.FSNAME.NOT_MATCHES}'
          value: ^(/dev|/sys|/run|/proc|.+/shm$)
          description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$VFS.FS.FSTYPE.MATCHES}'
          value: '.*(\.4|\.9|hrStorageFixedDisk|hrStorageFlashMemory)$'
          description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in filesystems discovery. Can be overridden on the host or linked template level.'
        -
          macro: '{$VFS.FS.PUSED.MAX.CRIT}'
          value: '90'
        -
          macro: '{$VFS.FS.PUSED.MAX.WARN}'
          value: '80'
  graphs:
    -
      name: 'CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'HOST-RESOURCES-MIB CPU SNMP'
            key: system.cpu.util