Major updates on the road to 0.7

git-svn-id: http://www.observium.org/svn/observer/trunk@492 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-10-28 13:49:37 +00:00
parent bb969a845a
commit 1f1eda9764
47 changed files with 1034 additions and 1235 deletions
+14 -10
View File
@@ -25,19 +25,23 @@ while ($device = mysql_fetch_array($device_query)) {
$host = $id;
echo("\nDetecting CDP neighbours on $device[1]...\n");
$snmp = new snmpCDP($hostname, $community);
$ports = $snmp->getports();
$cdp = $snmp->explore_cdp($ports);
# $snmp = new snmpCDP($hostname, $community);
# $ports = $snmp->getports();
# $cdp = $snmp->explore_cdp($ports);
$cdp_links = "";
# $cdp_links = "";
foreach (array_keys($cdp) as $key) {
$port = $ports[$key];
$link = $cdp[$key];
$cdp_links .= $hostname . "," . $port['desc'] . "," . $link['host'] . "," . $link['port'] . "\n";
}
# foreach (array_keys($cdp) as $key) {
# $port = $ports[$key];
# $link = $cdp[$key];
# $cdp_links .= $hostname . "," . $port['desc'] . "," . $link['host'] . "," . $link['port'] . "\n";
# }
$cdp_links = trim($cdp_links);
# $cdp_links = trim($cdp_links);
foreach ( explode("\n" ,$cdp_links) as $link ) {
if ($link == "") { break; }