FS#36: allow hostnames as parameter for discovery and polling

git-svn-id: http://www.observium.org/svn/observer/trunk@1211 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-06-18 18:12:35 +00:00
parent 36c276646a
commit e11769584b
2 changed files with 16 additions and 2 deletions

View File

@@ -21,7 +21,14 @@ if ($options['h'] == "odd") {
} elseif ($options['h'] == "all") {
$where = " "; $doing = "all";
} elseif($options['h']) {
$where = "AND `device_id` = '".$options['h']."'"; $doing = "Host ".$options['h'];
if (is_numeric($options['h']))
{
$where = "AND `device_id` = '".$options['h']."'"; $doing = "Host ".$options['h'];
}
else
{
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'"; $doing = "Host ".$options['h'];
}
} elseif ($options['i'] && isset($options['n'])) {
$where = "AND MOD(device_id,".$options['i'].") = '" . $options['n'] . "'"; $doing = "Proc ".$options['n'] ."/".$options['i'];
}