Explorar o código

Ignore unknown OIDs

Barry O'Donovan %!s(int64=13) %!d(string=hai) anos
pai
achega
043755f65b
Modificáronse 2 ficheiros con 10 adicións e 1 borrados
  1. 1 0
      .gitignore
  2. 9 1
      OSS/SNMP/MIBS/Cisco/CDP.php

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 .buildpath
 .project
 .settings/
+*~

+ 9 - 1
OSS/SNMP/MIBS/Cisco/CDP.php

@@ -588,7 +588,15 @@ class CDP extends \OSS\SNMP\MIBS\Cisco
             $neighbours[ $neighbourCdpId ][$count]['localPortId']   = $localPortId;
             $neighbours[ $neighbourCdpId ][$count]['localPortName'] = $this->getSNMP()->useIface()->names()[$localPortId];
             $neighbours[ $neighbourCdpId ][$count]['localPort']     = $this->getSNMP()->useIface()->descriptions()[$localPortId];
-            $neighbours[ $neighbourCdpId ][$count]['isLAG']         = $this->getSNMP()->useLAG()->isAggregatePorts()[$localPortId];
+            try
+            {
+                $neighbours[ $neighbourCdpId ][$count]['isLAG']     = $this->getSNMP()->useLAG()->isAggregatePorts()[$localPortId];
+            }
+            catch( \OSS\Exception $e )
+            {
+                $neighbours[ $neighbourCdpId ][$count]['isLAG']     = false;
+            }
+
             $neighbours[ $neighbourCdpId ][$count]['remotePort']    = $this->neighbourPort()[$localPortId];
         }