Deleted cdp.php

git-svn-id: http://www.observium.org/svn/observer/trunk@14 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-03 16:05:55 +00:00
parent 74ea50b482
commit e3409bd379

25
cdp.php
View File

@@ -1,25 +0,0 @@
#!/usr/bin/php
<?php
include("config.php");
include("includes/functions.php");
include("includes/cdp.php");
$device_query = mysql_query("SELECT id,hostname,community FROM `devices` WHERE `ignore` = '0' AND status = '1' AND `os` = 'IOS' ORDER BY `id` ASC");
while ($device = mysql_fetch_row($device_query)) {
echo("Detecting CDP neighbours on $device[1]...\n");
$snmp = new snmpCDP($device[1], $device[2]);
$ports = $snmp->getports();
$cdp = $snmp->explore_cdp($ports);
foreach (array_keys($cdp) as $key) {
$port = $ports[$key];
$link = $cdp[$key];
$loc_if[$key] = @mysql_result(mysql_query("SELECT `id` FROM `interfaces` WHERE host = '" . $device['id'] . "' AND `if` = '" . $port['desc'] . "'"), 0);
echo( $key . "||" . $hostname . "||" . $loc_if[$key] . "||" . $port['desc'] . "||" . $link['host'] . "||" . $link['port'] . "\n" );
}
}
?>