fix: Don't work around bad implementations in snmpwalk_group (#7876)

This commit is contained in:
Tony Murray
2017-12-09 10:39:37 -06:00
committed by Neil Lathwood
parent 2370072a14
commit ab2aacec0f
2 changed files with 5 additions and 10 deletions

View File

@@ -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';

View File

@@ -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;