move poller.php (inc os/system) to db* (and others, but poller is biggest change)

git-svn-id: http://www.observium.org/svn/observer/trunk@2298 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-13 11:42:26 +00:00
parent f355e33b64
commit bc0cdd2415
9 changed files with 45 additions and 41 deletions

View File

@@ -38,7 +38,7 @@ if (isset($argv[1]) && $argv[1])
}
list($hostshort) = explode(".", $host);
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `hostname` = '".mres($host)."'"), 0) == '0')
if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($host)) == '0')
{
if (isDomainResolves($argv[1]))
{
@@ -69,4 +69,4 @@ if (isset($argv[1]) && $argv[1])
} else { echo("Already got host $host\n"); }
} else { echo("Add Host Tool\nUsage: ./addhost.php <hostname> [community] [v1|v2c] [port] [" . join("|",$config['snmp']['transports']) . "]\n"); }
?>
?>