mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02: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:
+16
-13
@@ -26,21 +26,24 @@ echo("Observium v".$config['version']." Discovery\n\n");
|
|||||||
|
|
||||||
$options = getopt("h:t:i:n:d::a::");
|
$options = getopt("h:t:i:n:d::a::");
|
||||||
|
|
||||||
if ($options['h'] == "odd") { $options['n'] = "1"; $options['i'] = "2"; }
|
if (isset($options['h']))
|
||||||
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 (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']."'";
|
if (is_numeric($options['h']))
|
||||||
$doing = $options['h'];
|
{
|
||||||
}
|
$where = "AND `device_id` = '".$options['h']."'";
|
||||||
else
|
$doing = $options['h'];
|
||||||
{
|
}
|
||||||
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'";
|
else
|
||||||
$doing = $options['h'];
|
{
|
||||||
|
$where = "AND `hostname` LIKE '".str_replace('*','%',mres($options['h']))."'";
|
||||||
|
$doing = $options['h'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user