mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Don't work around bad implementations in snmpwalk_group (#7876)
This commit is contained in:
committed by
Neil Lathwood
parent
2370072a14
commit
ab2aacec0f
@@ -62,13 +62,13 @@ foreach ($packetlogic_stats as $index => $port) {
|
||||
$procera_port = array();
|
||||
foreach ($channelTypes as $cType) {
|
||||
foreach ($required as $ifEntry => $IfxStat) {
|
||||
$procera_port[$ifEntry] = $packetlogic_stats[$index][$cType['type'].$IfxStat];
|
||||
$procera_port[$ifEntry] = $packetlogic_stats[$index][$cType['type'].$IfxStat][0];
|
||||
}
|
||||
$negotiatedMedia = $packetlogic_stats[$index][$cType['type']."NegotiatedMedia"];
|
||||
$procera_port['ifName'] = $packetlogic_stats[$index]['channelName']. ' '.$cType['name'];
|
||||
$procera_port['ifDescr'] = $packetlogic_stats[$index]['channelName']. ' '.$cType['name'];
|
||||
$negotiatedMedia = $packetlogic_stats[$index][$cType['type']."NegotiatedMedia"][0];
|
||||
$procera_port['ifName'] = $packetlogic_stats[$index]['channelName'][0]. ' '.$cType['name'];
|
||||
$procera_port['ifDescr'] = $packetlogic_stats[$index]['channelName'][0]. ' '.$cType['name'];
|
||||
$procera_port['ifConnectorPresent'] = ($negotiatedMedia != '0' ? "true" : "false");
|
||||
$procera_port['ifOperStatus'] = ($packetlogic_stats[$index]['channelActive'] == 1 ? "up" : "down");
|
||||
$procera_port['ifOperStatus'] = ($packetlogic_stats[$index]['channelActive'][0] == 1 ? "up" : "down");
|
||||
$procera_port['ifSpeed'] = $mediaType[$negotiatedMedia]['ifSpeed'];
|
||||
$procera_port['ifDuplex'] = $mediaType[$negotiatedMedia]['ifDuplex'];
|
||||
$procera_port['ifType'] = 'ethernetCsmacd';
|
||||
|
||||
@@ -602,11 +602,6 @@ function snmpwalk_group($device, $oid, $mib = '', $depth = 1, $array = array())
|
||||
$parts = $parts[1];
|
||||
array_splice($parts, $depth, 0, array_shift($parts)); // move the oid name to the correct depth
|
||||
|
||||
// some tables don't use entries so they end with .0
|
||||
if (end($parts) == '.0') {
|
||||
array_pop($parts);
|
||||
}
|
||||
|
||||
$line = strtok("\n"); // get the next line and concatenate multi-line values
|
||||
while ($line !== false && !str_contains($line, '=')) {
|
||||
$value .= $line . PHP_EOL;
|
||||
|
||||
Reference in New Issue
Block a user