mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -26,21 +26,24 @@ 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 (is_numeric($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'])
|
||||
{
|
||||
$where = "AND `device_id` = '".$options['h']."'";
|
||||
$doing = $options['h'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'";
|
||||
$doing = $options['h'];
|
||||
if (is_numeric($options['h']))
|
||||
{
|
||||
$where = "AND `device_id` = '".$options['h']."'";
|
||||
$doing = $options['h'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'";
|
||||
$doing = $options['h'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user