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

suresine_snmp.yaml « suresine_snmp « morningstar_snmp « net « templates - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c66f5930368f92565606666cec6ad39a2b84497f (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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
zabbix_export:
  version: '5.4'
  date: '2021-05-09T00:00:00Z'
  groups:
    -
      name: Templates/Modules
  templates:
    -
      template: 'Morningstar SureSine SNMP'
      name: 'Morningstar SureSine SNMP'
      description: |
        MIBs used:
        SURESINE
        
        Template tooling version used: 0.38
      groups:
        -
          name: Templates/Modules
      items:
        -
          name: 'Battery: Battery Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.30.0
          key: 'battery.voltage.discovery[batteryVoltageSlow.0]'
          delay: 15m
          history: '0'
          value_type: FLOAT
          units: V
          description: 'MIB: SURESINE'
          preprocessing:
            -
              type: MULTIPLIER
              parameters:
                - '2.581787109375E-4'
            -
              type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            -
              tag: Application
              value: 'Zabbix raw items'
        -
          name: 'Load: A/C Current'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.31.0
          key: 'load.ac_current[acCurrent.0]'
          history: 7d
          value_type: FLOAT
          description: |
            MIB: SURESINE
            Description:AC Output Current
            Scaling Factor:0.0001953125
            Units:A
            Range:[0.0, 17]
            Modbus address:0x0005
          preprocessing:
            -
              type: MULTIPLIER
              parameters:
                - '1.953125E-4'
            -
              type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            -
              tag: Application
              value: Load
        -
          name: 'Load: State'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.33.0
          key: 'load.state[loadState.0]'
          history: 7d
          value_type: FLOAT
          description: |
            MIB: SURESINE
            Description:Load State
            Modbus address:0x000B
            
             0: Start
            1: LoadOn
            2: LvdWarning
            3: LowVoltageDisconnect
            4: Fault
            5: Disconnect
            6: NormalOff
            7: UnknownState
            8: Standby
          valuemap:
            name: 'SureSine load state'
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            -
              tag: Application
              value: Load
          triggers:
            -
              expression: 'last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"fault"}'
              name: 'Load: Device load in critical state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.WARN:"lvdWarning"}  or last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.WARN:"override"}'
              name: 'Load: Device load in warning state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                -
                  name: 'Load: Device load in critical state'
                  expression: 'last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar SureSine SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"fault"}'
        -
          name: 'Status: Alarms'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.34.0
          key: 'status.alarms[alarms.0]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            MIB: SURESINE
            Description:Faults
            Modbus address:0x0007
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                    'heatsinkTempSensorOpen',
                    'heatsinkTempSensorShort',
                    'unknownAlarm',
                    'suresineHot'
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                    result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                      if (flags & f) {
                          result.push(FIELDS[i]);
                      }
                  }
                  
                  return result.length ? result.join('\n') : 'No alarms';
          tags:
            -
              tag: Application
              value: Status
          triggers:
            -
              expression: 'count(/Morningstar SureSine SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorOpen")=2'
              name: 'Status: Device has "heatsinkTempSensorOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
            -
              expression: 'count(/Morningstar SureSine SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorShort")=2'
              name: 'Status: Device has "heatsinkTempSensorShort" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
            -
              expression: 'count(/Morningstar SureSine SNMP/status.alarms[alarms.0],#3,"like","suresineHot")=2'
              name: 'Status: Device has "suresineHot" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
            -
              expression: 'count(/Morningstar SureSine SNMP/status.alarms[alarms.0],#3,"like","unknownAlarm")=2'
              name: 'Status: Device has "unknownAlarm" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
        -
          name: 'Status: Faults'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.35.0
          key: 'status.faults[faults.0]'
          history: 1h
          trends: '0'
          value_type: TEXT
          description: |
            MIB: SURESINE
            Description:Faults
            Modbus address:0x0007
          preprocessing:
            -
              type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                    'reset',
                    'overcurrent',
                    'unknownFault',
                    'software',
                    'highVoltageDisconnect',
                    'suresineHot',
                    'dipSwitchChanged',
                    'customSettingsEdit'
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                    result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                      if (flags & f) {
                          result.push(FIELDS[i]);
                      }
                  }
                  
                  return result.length ? result.join('\n') : 'No faults';
          tags:
            -
              tag: Application
              value: Status
          triggers:
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","customSettingsEdit")=2'
              name: 'Status: Device has "customSettingsEdit" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","dipSwitchChanged")=2'
              name: 'Status: Device has "dipSwitchChanged" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","highVoltageDisconnect")=2'
              name: 'Status: Device has "highVoltageDisconnect" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","overcurrent")=2'
              name: 'Status: Device has "overcurrent" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","reset")=2'
              name: 'Status: Device has "reset" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","software")=2'
              name: 'Status: Device has "software" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","suresineHot")=2'
              name: 'Status: Device has "suresineHot" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
            -
              expression: 'count(/Morningstar SureSine SNMP/status.faults[faults.0],#3,"like","unknownFault")=2'
              name: 'Status: Device has "unknownFault" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
        -
          name: 'Status: Uptime'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.2.1.1.3.0
          key: status.uptime
          history: 7d
          units: uptime
          description: 'Device uptime in seconds'
          preprocessing:
            -
              type: MULTIPLIER
              parameters:
                - '0.01'
          tags:
            -
              tag: Application
              value: Status
          triggers:
            -
              expression: 'last(/Morningstar SureSine SNMP/status.uptime)<10m'
              name: 'Status: Device has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes'
              manual_close: 'YES'
            -
              expression: 'nodata(/Morningstar SureSine SNMP/status.uptime,5m)=1'
              name: 'Status: Failed to fetch data (or no data for 5m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 5 minutes'
              manual_close: 'YES'
        -
          name: 'Temperature: Heatsink'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.4.1.33333.9.32.0
          key: 'temp.heatsink[heatsinkTemperature.0]'
          history: 7d
          value_type: FLOAT
          units: C
          description: |
            MIB: SURESINE
            Description:Heatsink Temperature
            Scaling Factor:1
            Units:C
            Range:[-128, 127]
            Modbus address:0x0006
          tags:
            -
              tag: Application
              value: Temperature
      discovery_rules:
        -
          name: 'Battery voltage discovery'
          type: DEPENDENT
          key: battery.voltage.discovery
          delay: '0'
          description: 'Discovery for battery voltage triggers'
          item_prototypes:
            -
              name: 'Battery: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 1.3.6.1.4.1.33333.9.30.0
              key: 'battery.voltage[batteryVoltageSlow.0{#SINGLETON}]'
              history: 7d
              value_type: FLOAT
              units: V
              description: |
                MIB: SURESINE
                Description:Battery Voltage(slow)
                Scaling Factor:0.0002581787109375
                Units:V
                Range:[0.0, 17.0]
                Modbus address:0x0004
              preprocessing:
                -
                  type: MULTIPLIER
                  parameters:
                    - '2.581787109375E-4'
                -
                  type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                -
                  tag: Application
                  value: Battery
              trigger_prototypes:
                -
                  expression: 'min(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  name: 'Battery: Critically high battery voltage (over {#VOLTAGE.MAX.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                -
                  expression: 'max(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  name: 'Battery: Critically low battery voltage (below {#VOLTAGE.MIN.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                -
                  expression: 'min(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.WARN}'
                  name: 'Battery: High battery voltage (over {#VOLTAGE.MAX.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    -
                      name: 'Battery: Critically high battery voltage (over {#VOLTAGE.MAX.CRIT}V for 5m)'
                      expression: 'min(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                -
                  expression: 'max(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.WARN}'
                  name: 'Battery: Low battery voltage (below {#VOLTAGE.MIN.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    -
                      name: 'Battery: Critically low battery voltage (below {#VOLTAGE.MIN.CRIT}V for 5m)'
                      expression: 'max(/Morningstar SureSine SNMP/battery.voltage[batteryVoltageSlow.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
          graph_prototypes:
            -
              name: 'Voltage: Battery{#SINGLETON}'
              graph_items:
                -
                  drawtype: GRADIENT_LINE
                  color: 1A7C11
                  item:
                    host: 'Morningstar SureSine SNMP'
                    key: 'battery.voltage[batteryVoltageSlow.0{#SINGLETON}]'
          master_item:
            key: 'battery.voltage.discovery[batteryVoltageSlow.0]'
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  var v_range = [
                        [[0, 18], [12, 15, 11.5, 15.5]],
                        [[18, 36], [24, 30, 23, 31]],
                        [[36, 99], [48, 60, 46, 62]],
                    ],
                    result = [];
                  
                  for (var idx in v_range) {
                      if (v_range[idx][0][0] < value && value <= v_range[idx][0][1]) {
                          result = [{
                              '{#VOLTAGE.MIN.WARN}': parseInt({$VOLTAGE.MIN.WARN}) || v_range[idx][1][0],
                              '{#VOLTAGE.MAX.WARN}': parseInt({$VOLTAGE.MAX.WARN}) || v_range[idx][1][1],
                              '{#VOLTAGE.MIN.CRIT}': parseInt({$VOLTAGE.MIN.CRIT}) || v_range[idx][1][2],
                              '{#VOLTAGE.MAX.CRIT}': parseInt({$VOLTAGE.MAX.CRIT}) || v_range[idx][1][3],
                              '{#SINGLETON}': ''
                          }];
                          break;
                      }
                  }
                  
                  return JSON.stringify(result);
      macros:
        -
          macro: '{$BATTERY.TEMP.MAX.CRIT}'
          value: '60'
          description: 'Battery high temperature critical value'
        -
          macro: '{$BATTERY.TEMP.MAX.WARN}'
          value: '45'
          description: 'Battery high temperature warning value'
        -
          macro: '{$BATTERY.TEMP.MIN.CRIT}'
          value: '-20'
          description: 'Battery low temperature critical value'
        -
          macro: '{$BATTERY.TEMP.MIN.WARN}'
          value: '0'
          description: 'Battery low temperature warning value'
        -
          macro: '{$CHARGE.STATE.CRIT}'
          value: '4'
          description: fault
        -
          macro: '{$CHARGE.STATE.WARN}'
          value: '2'
          description: disconnect
        -
          macro: '{$LOAD.STATE.CRIT:"fault"}'
          value: '4'
          description: fault
        -
          macro: '{$LOAD.STATE.CRIT:"lvd"}'
          value: '3'
          description: lvd
        -
          macro: '{$LOAD.STATE.WARN:"disconnect"}'
          value: '5'
          description: disconnect
        -
          macro: '{$LOAD.STATE.WARN:"lvdWarning"}'
          value: '2'
          description: lvdWarning
        -
          macro: '{$LOAD.STATE.WARN:"override"}'
          value: '7'
          description: override
        -
          macro: '{$VOLTAGE.MAX.CRIT}'
        -
          macro: '{$VOLTAGE.MAX.WARN}'
        -
          macro: '{$VOLTAGE.MIN.CRIT}'
        -
          macro: '{$VOLTAGE.MIN.WARN}'
      valuemaps:
        -
          name: 'SureSine load state'
          mappings:
            -
              value: '0'
              newvalue: Start
            -
              value: '1'
              newvalue: LoadOn
            -
              value: '2'
              newvalue: LvdWarning
            -
              value: '3'
              newvalue: LowVoltageDisconnect
            -
              value: '4'
              newvalue: Fault
            -
              value: '5'
              newvalue: Disconnect
            -
              value: '6'
              newvalue: NormalOff
            -
              value: '7'
              newvalue: UnknownState
            -
              value: '8'
              newvalue: Standby
  graphs:
    -
      name: 'Current: A/C Load'
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'Morningstar SureSine SNMP'
            key: 'load.ac_current[acCurrent.0]'
    -
      name: 'Temperature: Heatsink'
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 1A7C11
          item:
            host: 'Morningstar SureSine SNMP'
            key: 'temp.heatsink[heatsinkTemperature.0]'