Created
February 15, 2017 14:12
-
-
Save wilpig/e6949747d51d11398577e352c7fba97a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function findFirstPort( $DeviceID ) { | |
if(!$dev=SwitchInfo::BasicTests($DeviceID)){ | |
return false; | |
} | |
$x=array(); | |
foreach(self::OSS_SNMP_Lookup($dev,"names") as $index => $portdesc ) { | |
if ( preg_match( "/([0-9]\:|bond|\"[A-Z]|swp|eth|Ethernet|Port-Channel|\/)[01]$/", $portdesc )) { | |
$x[$index] = $portdesc; | |
} // Find lines that end with /1 | |
} | |
return $x; | |
} | |
Change TO: | |
static function findFirstPort( $DeviceID ) { | |
if(!$dev=SwitchInfo::BasicTests($DeviceID)){ | |
return false; | |
} | |
$x=array(); | |
foreach(self::OSS_SNMP_Lookup($dev,"names") as $index => $portdesc ) { | |
$x[$index] = $portdesc; | |
} | |
return $x; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment