Merge branch '1572-Descripción-de-interfaces-dell-powerconnect-dev' into 'develop'

Changed explode in wizard snmp interface explorer

See merge request artica/pandorafms!1256
This commit is contained in:
vgilc 2018-01-22 10:40:03 +01:00
commit d471b0889c
1 changed files with 3 additions and 11 deletions

View File

@ -96,7 +96,7 @@ if ($snmpwalk) {
// We get here only the interface part of the MIB, not full mib
foreach($snmpis as $key => $snmp) {
$data = explode(': ',$snmp);
$data = explode (': ',$snmp, 2);
$keydata = explode('::',$key);
$keydata2 = explode('.',$keydata[1]);
@ -106,16 +106,8 @@ if ($snmpwalk) {
}
if (array_key_exists(1,$data)) {
// Fixed for switch dell powerconnect
if(count($data) > 2) {
$interfaces[$keydata2[1]][$keydata2[0]]['type'] = $data[0];
unset($data[0]);
$interfaces[$keydata2[1]][$keydata2[0]]['value'] = implode(": ",$data);
} else {
$interfaces[$keydata2[1]][$keydata2[0]]['type'] = $data[0];
$interfaces[$keydata2[1]][$keydata2[0]]['value'] = $data[1];
}
$interfaces[$keydata2[1]][$keydata2[0]]['type'] = $data[0];
$interfaces[$keydata2[1]][$keydata2[0]]['value'] = $data[1];
} else {
$interfaces[$keydata2[1]][$keydata2[0]]['type'] = '';
$interfaces[$keydata2[1]][$keydata2[0]]['value'] = $data[0];