remove the last usage of config variables outside of the $config array ($rrd_file) + fixed adduser script

git-svn-id: http://www.observium.org/svn/observer/trunk@354 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-03-16 15:19:44 +00:00
parent 98ba6a4f83
commit 83eb114da1
18 changed files with 74 additions and 91 deletions
+7 -5
View File
@@ -34,7 +34,7 @@ while ($device = mysql_fetch_array($device_query)) {
$cdp_links = trim($cdp_links);
echo("\n$cdp_links\n\n");
# echo("\n$cdp_links\n\n");
foreach ( explode("\n" ,$cdp_links) as $link ) {
if ($link == "") { break; }
@@ -49,8 +49,10 @@ while ($device = mysql_fetch_array($device_query)) {
$ip = gethostbyname($dst_host);
if ( match_network($config['nets'], $ip) ) {
if ( mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `sysName` = '$dst_host'"), 0) == '0' ) {
echo("++ Creating: $dst_host \n");
#createHost ($dst_host, $community, "v2c");
if($config['cdp_autocreate']) {
echo("++ Creating: $dst_host \n");
createHost ($dst_host, $community, "v2c");
}
} else {
echo(".. Already got host $dst_host\n");
}
@@ -96,9 +98,9 @@ while($entry = mysql_fetch_array($query)) {
}
if (!$alive) {
mysql_query("DELETE FROM `links` WHERE `src_if` = '$entry[src_if]' AND `dst_if` = '$entry[dst_if]'");
echo("$src_if_id -> $dst_if_id REMOVED \n");
# echo("$src_if_id -> $dst_if_id REMOVED \n");
} else {
echo("$src_if_id -> $dst_if_id VALID \n");
# echo("$src_if_id -> $dst_if_id VALID \n");
}
}