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

View File

@@ -6,10 +6,13 @@ include("includes/functions.php");
$search = $argv[1] . "$";
$data = trim(`cat ips-scanned.txt | grep alive | cut -d" " -f 1 | egrep $search`);
foreach( explode("\n", $data) as $ip) {
$snmp = `snmpget -t 0.2 -v2c -c $community $ip sysName.0`;
$snmp = shell_exec("snmpget -t 0.2 -v2c -c ".$config['community']." $ip sysName.0");
if(strstr($snmp, "STRING")) {
$hostname = trim(str_replace("SNMPv2-MIB::sysName.0 = STRING: ","", $snmp));
if(mysql_result(mysql_query("SELECT COUNT(device_id) FROM devices WHERE hostname = '$hostname'"),0) == '0') {