From dbeaf3b35ef1b3a3bdb59d8f7a0fc04a7971108b Mon Sep 17 00:00:00 2001 From: Martin Zatloukal Date: Sat, 9 Dec 2017 20:53:40 +0100 Subject: [PATCH] device: Added Mikrotik POE sensors (#7883) * Add Mikrotik POE sensors * Add Mikrotik POE sensors --- includes/definitions/discovery/routeros.yaml | 25 +++++++++++++++++++- includes/snmp.inc.php | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/includes/definitions/discovery/routeros.yaml b/includes/definitions/discovery/routeros.yaml index b3dcafa24a..2f0e6d5927 100644 --- a/includes/definitions/discovery/routeros.yaml +++ b/includes/definitions/discovery/routeros.yaml @@ -18,6 +18,13 @@ modules: divisor: 1000 descr: mtxrOpticalName index: 'mtxrOpticalSupplyVoltage.{{ $index }}' + - + oid: mtxrPOETable + value: mtxrPOEVoltage + num_oid: .1.3.6.1.4.1.14988.1.1.15.1.1.4. + divisor: 10 + descr: '{{ $mtxrPOEName }} POE' + index: 'mtxrPOEVoltage.{{ $index }}' current: data: - @@ -27,6 +34,13 @@ modules: divisor: 1000 descr: '{{ $mtxrOpticalName }} Tx' index: 'mtxrOpticalTxBiasCurrent.{{ $index }}' + - + oid: mtxrPOETable + value: mtxrPOECurrent + num_oid: .1.3.6.1.4.1.14988.1.1.15.1.1.5. + divisor: 10 + descr: '{{ $mtxrPOEName }} POE' + index: 'mtxrPOECurrent.{{ $index }}' dbm: data: - @@ -66,4 +80,13 @@ modules: states: - { descr: no, graph: 1, value: 0, generic: 0 } - { descr: yes, graph: 1, value: 1, generic: 2 } - - { descr: 'null', graph: 1, value: 2, generic: 3 } \ No newline at end of file + - { descr: 'null', graph: 1, value: 2, generic: 3 } + power: + data: + - + oid: mtxrPOETable + value: mtxrPOEPower + num_oid: .1.3.6.1.4.1.14988.1.1.15.1.1.6. + divisor: 10 + descr: '{{ $mtxrPOEName }} POE' + index: 'mtxrPOEPower.{{ $index }}' diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index d441fdb330..33c1b75def 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -592,7 +592,7 @@ function snmpwalk_group($device, $oid, $mib = '', $depth = 1, $array = array()) $line = strtok($data, "\n"); while ($line !== false) { - if (str_contains($line, 'at this OID')) { + if (str_contains($line, 'at this OID')||str_contains($line, 'this MIB View')) { $line = strtok("\n"); continue; }