diff --git a/includes/polling/ports/os/luminato.inc.php b/includes/polling/ports/os/luminato.inc.php index ec61c0fb09..579984a214 100644 --- a/includes/polling/ports/os/luminato.inc.php +++ b/includes/polling/ports/os/luminato.inc.php @@ -26,17 +26,17 @@ $ver = intval($device['version']); d_echo('PORTS: Luminato v' . $ver); -$rfcmib = SnmpQuery::walk('RFC1213-MIB::ifSpeed')->table(2); +// add IF-MIB::ifSpeed if missing +if (! array_key_exists('ifSpeed', Arr::first($port_stats))) { + SnmpQuery::hideMib()->walk('IF-MIB::ifSpeed')->table(2, $port_stats); +} foreach ($port_stats as $key => $data) { - $speed = $rfcmib[$key]['RFC1213-MIB::ifSpeed']; - - if ($ver >= 20) { + // emulate ifOperStatus if missing + if (empty($data['ifOperStatus'])) { $port_stats[$key]['ifOperStatus'] = $data['ifConnectorPresent'] ? 'up' : 'down'; - } else { - $speed = $speed / 1000000; } - $port_stats[$key]['ifHighSpeed'] = $speed; - $port_stats[$key]['ifSpeed'] = 0; + // ifHighSpeed is always broken and ver >= 20 ifSpeed is actually ifHighSpeed + $port_stats[$key]['ifHighSpeed'] = ($ver < 20 ? $data['ifSpeed'] / 1000000 : $data['ifSpeed']); } diff --git a/tests/data/luminato_c12.json b/tests/data/luminato_c12.json index 8fb751700e..33fbb6a3cb 100644 --- a/tests/data/luminato_c12.json +++ b/tests/data/luminato_c12.json @@ -6,7 +6,7 @@ "sysName": "luminato", "sysObjectID": ".1.3.6.1.4.1.3715.17", "sysDescr": "Teleste Luminato 8.2.6", - "sysContact": "dohlad@gecom.sk", + "sysContact": "", "version": "8.2.6", "hardware": "LCH-D C12", "features": null, diff --git a/tests/snmpsim/luminato_c12.snmprec b/tests/snmpsim/luminato_c12.snmprec index de7735400f..09bdb96918 100644 --- a/tests/snmpsim/luminato_c12.snmprec +++ b/tests/snmpsim/luminato_c12.snmprec @@ -1,7 +1,7 @@ 1.3.6.1.2.1.1.1.0|4x|54656c65737465204c756d696e61746f20382e322e36 1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.3715.17 1.3.6.1.2.1.1.3.0|67|242973613 -1.3.6.1.2.1.1.4.0|4x|646f686c6164406765636f6d2e736b +1.3.6.1.2.1.1.4.0|4x|3C707269766174653E 1.3.6.1.2.1.1.5.0|4|Luminato 1.3.6.1.2.1.1.6.0|4| 1.3.6.1.2.1.1.7.0|2|0