Improve Sentry4 discovery (#8407)

* feature: Improve Sentry4 discovery

* Added test data

* Updated to take into account C/F conversion

* fixed test json data
This commit is contained in:
Søren Rosiak 2018-03-29 07:22:17 +02:00 committed by Tony Murray
parent 314a552437
commit 8ec70a92af
8 changed files with 8726 additions and 4605 deletions

View File

@ -0,0 +1,491 @@
mib: Sentry4-MIB
modules:
sensors:
pre-cache:
data:
- oid:
- st4InputCordName
- st4LineLabel
- st4PhaseLabel
- st4OcpLabel
- st4BranchLabel
current:
data:
-
oid: st4LineCurrent
num_oid: .1.3.6.1.4.1.1718.4.1.4.3.1.3.
index: 'st4LineCurrent.{{ $index }}'
descr: Line, {{ $st4LineLabel }}, Current
divisor: 100
-
oid: st4PhaseCurrent
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.6.
index: 'st4PhaseCurrent.{{ $index }}'
descr: Phase, {{ $st4PhaseLabel }}, Current
divisor: 100
frequency:
data:
-
oid: st4InputCordFrequency
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.11.
index: 'st4InputCord.{{ $index }}'
descr: Line, {{ $st4InputCordName }}, Frequency
divisor: 10
power:
data:
-
oid: st4InputCordActivePower
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.3.
index: 'st4InputCord.{{ $index }}'
descr: Cord, {{ $st4InputCordName }}, Active Power
divisor: 0
-
oid: st4PhaseActivePower
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.8.
index: 'st4PhaseActivePower.{{ $index }}'
descr: Phase, {{ $st4PhaseLabel }}, Active Power
divisor: 0
voltage:
data:
-
oid: st4PhaseVoltage
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.3.
index: 'st4PhaseVoltage.{{ $index }}'
descr: Phase, {{ $st4PhaseLabel }}, Voltage
divisor: 10
state:
data:
-
oid: st4UnitStatus
value: st4UnitStatus
num_oid: .1.3.6.1.4.1.1718.4.1.2.3.1.1.
descr: Unit Status
index: 'st4UnitStatus.{{ $index }}'
state_name: st4UnitStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4InputCordState
value: st4InputCordState
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.1.
descr: Input Cord State
index: 'st4InputCordState.{{ $index }}'
state_name: st4InputCordState
states:
- { descr: unknown, graph: 0, value: 0, generic: 3 }
- { descr: on, graph: 0, value: 1, generic: 0 }
- { descr: off, graph: 0, value: 2, generic: 3 }
-
oid: st4InputCordStatus
value: st4InputCordStatus
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.2.
descr: Input Cord Status
index: 'st4InputCordStatus.{{ $index }}'
state_name: st4InputCordStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4InputCordActivePowerStatus
value: st4InputCordActivePowerStatus
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.4.
descr: Input Cord Active Power Status
index: 'st4InputCordActivePowerStatus.{{ $index }}'
state_name: st4InputCordActivePowerStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4InputCordApparentPowerStatus
value: st4InputCordApparentPowerStatus
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.6.
descr: Input Cord Apparent Power Status
index: 'st4InputCordApparentPowerStatus.{{ $index }}'
state_name: st4InputCordApparentPowerStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4InputCordPowerFactorStatus
value: st4InputCordPowerFactorStatus
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.9.
descr: Input Cord Power Factor Status
index: 'st4InputCordPowerFactorStatus.{{ $index }}'
state_name: st4InputCordPowerFactorStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4InputCordOutOfBalanceStatus
value: st4InputCordOutOfBalanceStatus
num_oid: .1.3.6.1.4.1.1718.4.1.3.3.1.13.
descr: Input Out Of Balance Status
index: 'st4InputCordOutOfBalanceStatus.{{ $index }}'
state_name: st4InputCordOutOfBalanceStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4LineState
value: st4LineState
num_oid: .1.3.6.1.4.1.1718.4.1.4.3.1.1.
descr: Line {{ $st4LineLabel }} State
index: 'st4LineState.{{ $index }}'
state_name: st4LineState
states:
- { descr: unknown, graph: 0, value: 0, generic: 3 }
- { descr: on, graph: 0, value: 1, generic: 0 }
- { descr: off, graph: 0, value: 2, generic: 3 }
-
oid: st4LineStatus
value: st4LineStatus
num_oid: .1.3.6.1.4.1.1718.4.1.4.3.1.2.
descr: Line {{ $st4LineLabel }} Status
index: 'st4LineStatus.{{ $index }}'
state_name: st4LineStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4PhaseState
value: st4PhaseState
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.1.
descr: Phase {{ $st4PhaseLabel }} State
index: 'st4PhaseState.{{ $index }}'
state_name: st4PhaseState
states:
- { descr: unknown, graph: 0, value: 0, generic: 3 }
- { descr: on, graph: 0, value: 1, generic: 0 }
- { descr: off, graph: 0, value: 2, generic: 3 }
-
oid: st4PhaseStatus
value: st4PhaseStatus
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.2.
descr: Phase {{ $st4PhaseLabel }} Status
index: 'st4PhaseStatus.{{ $index }}'
state_name: st4PhaseStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4PhaseVoltageStatus
value: st4PhaseVoltageStatus
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.4.
descr: Phase {{ $st4PhaseLabel }} Voltage Status
index: 'st4PhaseVoltageStatus.{{ $index }}'
state_name: st4PhaseVoltageStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4PhasePowerFactorStatus
value: st4PhasePowerFactorStatus
num_oid: .1.3.6.1.4.1.1718.4.1.5.3.1.11.
descr: Phase {{ $st4PhaseLabel }} Power Factor Status
index: 'st4PhasePowerFactorStatus.{{ $index }}'
state_name: st4PhasePowerFactorStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4OcpStatus
value: st4OcpStatus
num_oid: .1.3.6.1.4.1.1718.4.1.6.3.1.1.
descr: Over-current Protector {{ $st4OcpLabel }} Status
index: 'st4OcpStatus.{{ $index }}'
state_name: st4OcpStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4BranchState
value: st4BranchState
num_oid: .1.3.6.1.4.1.1718.4.1.7.3.1.1.
descr: Branch {{ $st4OcpLabel }} State
index: 'st4BranchState.{{ $index }}'
state_name: st4BranchState
states:
- { descr: unknown, graph: 0, value: 0, generic: 3 }
- { descr: on, graph: 0, value: 1, generic: 0 }
- { descr: off, graph: 0, value: 2, generic: 3 }
-
oid: st4BranchStatus
value: st4BranchStatus
num_oid: .1.3.6.1.4.1.1718.4.1.7.3.1.2.
descr: Branch {{ $st4OcpLabel }} Status
index: 'st4BranchStatus.{{ $index }}'
state_name: st4BranchStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }
-
oid: st4BranchCurrentStatus
value: st4BranchCurrentStatus
num_oid: .1.3.6.1.4.1.1718.4.1.7.3.1.4.
descr: Branch Current {{ $st4OcpLabel }} Status
index: 'st4BranchCurrentStatus.{{ $index }}'
state_name: st4BranchCurrentStatus
states:
- { descr: normal, graph: 1, value: 0, generic: 0 }
- { descr: disabled, graph: 1, value: 1, generic: 3 }
- { descr: purged, graph: 1, value: 2, generic: 2 }
- { descr: reading, graph: 1, value: 5, generic: 2 }
- { descr: settle, graph: 1, value: 6, generic: 1 }
- { descr: notFound, graph: 1, value: 7, generic: 3 }
- { descr: lost, graph: 1, value: 8, generic: 1 }
- { descr: readError, graph: 1, value: 9, generic: 1 }
- { descr: noComm, graph: 1, value: 10, generic: 1 }
- { descr: pwrError, graph: 1, value: 11, generic: 2 }
- { descr: breakerTripped, graph: 1, value: 12, generic: 2 }
- { descr: fuseBlown, graph: 1, value: 13, generic: 2 }
- { descr: lowAlarm, graph: 1, value: 14, generic: 2 }
- { descr: lowWarning, graph: 1, value: 15, generic: 1 }
- { descr: highWarning, graph: 1, value: 16, generic: 1 }
- { descr: highAlarm, graph: 1, value: 17, generic: 2 }
- { descr: alarm, graph: 1, value: 18, generic: 2 }
- { descr: underLimit, graph: 1, value: 19, generic: 1 }
- { descr: overLimit, graph: 1, value: 20, generic: 1 }
- { descr: nvmFail, graph: 1, value: 21, generic: 2 }
- { descr: profileError, graph: 1, value: 22, generic: 2 }
- { descr: conflict, graph: 1, value: 23, generic: 2 }

View File

@ -1,34 +0,0 @@
<?php
/**
* sentry4.inc.php
*
* LibreNMS frequency discovery module for Sentry4
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
foreach ($pre_cache['sentry4_input'] as $index => $data) {
$descr = $data['st4InputCordName'];
$oid = ".1.3.6.1.4.1.1718.4.1.3.3.1.11.$index";
$current = $data['st4InputCordFrequency'];
$divisor = 10;
if ($current >= 0) {
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "st4InputCord.$index", 'sentry4', $descr, $divisor, 1, null, null, null, null, $current);
}
}

View File

@ -1,33 +0,0 @@
<?php
/**
* sentry4.inc.php
*
* LibreNMS power discovery module for Sentry4
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package LibreNMS
* @link http://librenms.org
* @copyright 2017 Neil Lathwood
* @author Neil Lathwood <gh+n@laf.io>
*/
foreach ($pre_cache['sentry4_input'] as $index => $data) {
$descr = $data['st4InputCordName'];
$oid = ".1.3.6.1.4.1.1718.4.1.3.3.1.3.$index";
$current = $data['st4InputCordActivePower'];
if ($current >= 0) {
discover_sensor($valid['sensor'], 'power', $device, $oid, "st4InputCord.$index", 'sentry4', $descr, 1, 1, null, null, null, null, $current);
}
}

View File

@ -22,27 +22,33 @@ $oids = trim($oids);
$divisor = '10';
$multiplier = '1';
if ($oids) {
$sentry_temp_scale = snmp_get($device, 'st4TempSensorScale.0', '-Ovq', 'Sentry4-MIB');
if ($sentry_temp_scale == 'fahrenheit') {
$user_func = 'convert_to_celsius';
} else {
$user_func = null;
}
echo 'ServerTech Sentry4 Temperature ';
}
foreach (explode("\n", $oids) as $data) {
$data = trim($data);
if ($data) {
list($oid, $descr) = explode(' ', $data, 2);
$split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)];
foreach (explode("\n", $oids) as $data) {
$data = trim($data);
if ($data) {
list($oid,$descr) = explode(' ', $data, 2);
$split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)];
// Sentry4-MIB::st4TempSensorValue
$temperature_oid = '.1.3.6.1.4.1.1718.4.1.9.3.1.1.1.' . $index;
$descr = 'Removable Sensor ' . $index;
$low_warn_limit = (snmp_get($device, "st4TempSensorLowWarning.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$low_limit = (snmp_get($device, "st4TempSensorLowAlarm.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$high_warn_limit = (snmp_get($device, "st4TempSensorHighWarning.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$high_limit = (snmp_get($device, "st4TempSensorHighAlarm.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$current = (snmp_get($device, "$temperature_oid", '-OvqU', 'Sentry4-MIB') / $divisor);
// Sentry4-MIB::st4TempSensorValue
$temperature_oid = '.1.3.6.1.4.1.1718.4.1.9.3.1.1.1.'.$index;
$descr = 'Removable Sensor '.$index;
$low_warn_limit = (snmp_get($device, "st4TempSensorLowWarning.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$low_limit = (snmp_get($device, "st4TempSensorLowAlarm.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$high_warn_limit = (snmp_get($device, "st4TempSensorHighWarning.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$high_limit = (snmp_get($device, "st4TempSensorHighAlarm.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
$current = (snmp_get($device, "$temperature_oid", '-OvqU', 'Sentry4-MIB') / $divisor);
if (is_numeric($current) && $current >= 0) {
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $index, 'sentry4', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
if (is_numeric($current) && $current >= 0) {
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $index, 'sentry4', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current, 'snmp', null, null, $user_func);
}
}
}
}

View File

@ -66,10 +66,6 @@ function poll_sensor($device, $class)
require 'includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php';
}
if (isset($sensor['user_func']) && function_exists($sensor['user_func'])) {
$sensor_value = $sensor['user_func']($sensor_value);
}
if ($class == 'temperature') {
preg_match('/[\d\.\-]+/', $sensor_value, $temp_response);
if (!empty($temp_response[0])) {
@ -165,6 +161,10 @@ function record_sensor_data($device, $all_sensors)
$sensor_value = ($sensor_value * $sensor['sensor_multiplier']);
}
if (isset($sensor['user_func']) && function_exists($sensor['user_func'])) {
$sensor_value = $sensor['user_func']($sensor_value);
}
$rrd_name = get_sensor_rrd_name($device, $sensor);
$rrd_def = RrdDefinition::make()->addDataset('sensor', 'GAUGE');

File diff suppressed because it is too large Load Diff

3308
tests/data/sentry4.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,122 @@
1.3.6.1.2.1.1.1.0|4|Sentry Smart PDU
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.1718.4
1.3.6.1.2.1.1.3.0|67|2254567
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.4.1.1718.4.1.2.3.1.1.1|2|0
1.3.6.1.4.1.1718.4.1.3.2.1.2.1.1|4|AA
1.3.6.1.4.1.1718.4.1.3.2.1.3.1.1|4|Master_Cord_A
1.3.6.1.4.1.1718.4.1.3.2.1.6.1.1|4|L15-30P
1.3.6.1.4.1.1718.4.1.3.2.1.7.1.1|2|2080
1.3.6.1.4.1.1718.4.1.3.2.1.8.1.1|2|200
1.3.6.1.4.1.1718.4.1.3.2.1.9.1.1|2|240
1.3.6.1.4.1.1718.4.1.3.2.1.10.1.1|2|30
1.3.6.1.4.1.1718.4.1.3.2.1.11.1.1|2|30
1.3.6.1.4.1.1718.4.1.3.2.1.12.1.1|2|10807
1.3.6.1.4.1.1718.4.1.3.2.1.20.1.1|2|3
1.3.6.1.4.1.1718.4.1.3.2.1.21.1.1|2|3
1.3.6.1.4.1.1718.4.1.3.2.1.22.1.1|2|3
1.3.6.1.4.1.1718.4.1.3.2.1.23.1.1|2|3
1.3.6.1.4.1.1718.4.1.3.2.1.24.1.1|2|36
1.3.6.1.4.1.1718.4.1.3.3.1.1.1.1|2|1
1.3.6.1.4.1.1718.4.1.3.3.1.2.1.1|2|0
1.3.6.1.4.1.1718.4.1.3.3.1.3.1.1|2|1701
1.3.6.1.4.1.1718.4.1.3.3.1.4.1.1|2|0
1.3.6.1.4.1.1718.4.1.3.3.1.5.1.1|2|1790
1.3.6.1.4.1.1718.4.1.3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