diff --git a/includes/discovery/ports.inc.php b/includes/discovery/ports.inc.php index 41d94b5e99..1d39337ef3 100755 --- a/includes/discovery/ports.inc.php +++ b/includes/discovery/ports.inc.php @@ -8,7 +8,7 @@ $ports = snmp_walk($device, "ifDescr", "-Onsq", "IF-MIB"); $ports = str_replace("\"", "", $ports); $ports = str_replace("ifDescr.", "", $ports); -$ports = str_replace(" ", "||", $ports); +#$ports = str_replace(" ", "||", $ports); $interface_ignored = 0; $interface_added = 0; @@ -16,7 +16,7 @@ $interface_added = 0; foreach (explode("\n", $ports) as $entry){ $entry = trim($entry); - list($ifIndex, $ifDescr) = explode("||", $entry, 2); + list($ifIndex, $ifDescr) = explode(" ", $entry, 2); if (!strstr($entry, "irtual")) { $if = trim(strtolower($ifDescr)); $nullintf = 0; @@ -39,7 +39,7 @@ foreach (explode("\n", $ports) as $entry){ if ($debug) echo("\n $if "); if ($nullintf == 0) { if (mysql_result(mysql_query("SELECT COUNT(*) FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '$ifIndex'"), 0) == '0') { - mysql_query("INSERT INTO `ports` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','$ifDescr')"); + mysql_query("INSERT INTO `ports` (`device_id`,`ifIndex`,`ifDescr`) VALUES ('".$device['device_id']."','$ifIndex','".mres($ifDescr)."')"); # Add Interface echo("+"); } else { diff --git a/test-discovery.php b/test-discovery.php index 8387b8e1b6..8ae0ac2cd8 100755 --- a/test-discovery.php +++ b/test-discovery.php @@ -31,6 +31,8 @@ if($argv[1] == "--device" && $argv[2]) { exit; } +$debug = 1; + if ($argv[2] == "--type" && $argv[3]) { $discovery_type = $argv[3]; } elseif ($argv[3] == "--type" && $argv[4]) {