From 9179d90950821d286f16e77f7d2c40ef6d55834d Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 16 Mar 2011 13:56:36 +0000 Subject: [PATCH] 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 --- discovery.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/discovery.php b/discovery.php index c21fba50e..4651c2bb4 100755 --- a/discovery.php +++ b/discovery.php @@ -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 | 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 -n Poll as instance of \n"); - echo(" Instances start at 0. 0-3 for -n 4\n\n"); - echo("-d Enable some debugging output\n"); + echo("-h | 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 -n Poll as instance of \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;