fixed r1871 discovery of new devices, thanks to Bill Fenner for testing and fixing, also made some php notices go away.

git-svn-id: http://www.observium.org/svn/observer/trunk@1873 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-16 14:21:33 +00:00
parent 826b3743db
commit 31cfad371f
+8 -5
View File
@@ -26,12 +26,14 @@ echo("Observium v".$config['version']." Discovery\n\n");
$options = getopt("h:t:i:n:d::a::");
if ($options['h'] == "odd") { $options['n'] = "1"; $options['i'] = "2"; }
elseif ($options['h'] == "even") { $options['n'] = "0"; $options['i'] = "2"; }
elseif ($options['h'] == "all") { $where = " "; $doing = "all"; }
elseif ($options['h'] == "new") { $where = "AND `last_discovered` = NULL"; $doing = "new"; }
elseif ($options['h'])
if (isset($options['h']))
{
if ($options['h'] == "odd") { $options['n'] = "1"; $options['i'] = "2"; }
elseif ($options['h'] == "even") { $options['n'] = "0"; $options['i'] = "2"; }
elseif ($options['h'] == "all") { $where = " "; $doing = "all"; }
elseif ($options['h'] == "new") { $where = "AND `last_discovered` IS NULL"; $doing = "new"; }
elseif ($options['h'])
{
if (is_numeric($options['h']))
{
$where = "AND `device_id` = '".$options['h']."'";
@@ -42,6 +44,7 @@ elseif ($options['h'])
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'";
$doing = $options['h'];
}
}
}
if (isset($options['i']) && $options['i'] && isset($options['n']))