add '-h new' to discovery.php, which you could cron more frequently. only polls new devices which have not been discovered. -untested-

git-svn-id: http://www.observium.org/svn/observer/trunk@1871 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-16 13:56:36 +00:00
parent 2dc2731765
commit 9179d90950
+9 -7
View File
@@ -29,6 +29,7 @@ $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 (is_numeric($options['h']))
@@ -68,13 +69,14 @@ if (isset($options['d']))
if (!$where)
{
echo("-h <device id> | <device hostname> Poll single device\n");
echo("-h odd Poll odd numbered devices (same as -i 2 -n 0)\n");
echo("-h even Poll even numbered devices (same as -i 2 -n 1)\n");
echo("-h all Poll all devices\n\n");
echo("-i <instances> -n <number> Poll as instance <number> of <instances>\n");
echo(" Instances start at 0. 0-3 for -n 4\n\n");
echo("-d Enable some debugging output\n");
echo("-h <device id> | <device hostname wildcard> Poll single device\n");
echo("-h odd Poll odd numbered devices (same as -i 2 -n 0)\n");
echo("-h even Poll even numbered devices (same as -i 2 -n 1)\n");
echo("-h all Poll all devices\n");
echo("-h new Poll all devices that have not had a discovery run before\n\n");
echo("-i <instances> -n <number> Poll as instance <number> of <instances>\n");
echo(" Instances start at 0. 0-3 for -n 4\n\n");
echo("-d Enable debugging output\n");
echo("\n");
echo("No polling type specified!\n");
exit;