mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix luminato port poll (#14217)
* Fix luminato port poll I still don't like it, but this improves the code consistency a bit. * better comments * Update luminato.inc.php
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"sysName": "luminato",
|
||||
"sysObjectID": ".1.3.6.1.4.1.3715.17",
|
||||
"sysDescr": "Teleste Luminato 8.2.6",
|
||||
"sysContact": "[email protected]",
|
||||
"sysContact": "<private>",
|
||||
"version": "8.2.6",
|
||||
"hardware": "LCH-D C12",
|
||||
"features": null,
|
||||
|
||||
@@ -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|<private>
|
||||
1.3.6.1.2.1.1.7.0|2|0
|
||||
|
||||
Reference in New Issue
Block a user