From 4d96296d1e60cacd2fdd12e6ead787f192a15572 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Tue, 8 Mar 2011 17:14:32 +0000 Subject: [PATCH] further minor cleanups of poller.php, with help from Corentin Chary git-svn-id: http://www.observium.org/svn/observer/trunk@1805 61d68cd4-352d-0410-923a-c4978735b2b8 --- poller.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/poller.php b/poller.php index bcd4ee0dd5..b7b583c419 100755 --- a/poller.php +++ b/poller.php @@ -65,14 +65,20 @@ if (isset($options['d'])) { echo("Starting polling run:\n\n"); $polled_devices = 0; $device_query = mysql_query("SELECT `device_id` FROM `devices` WHERE `ignore` = 0 AND `disabled` = 0 $where ORDER BY `device_id` ASC"); + while ($device = mysql_fetch_assoc($device_query)) { $device = mysql_fetch_assoc(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'")); + $status = 0; unset($array); $device_start = utime(); // Start counting device poll time echo($device['hostname'] . " ".$device['device_id']." ".$device['os']." "); - if($config['os'][$device['os']]['group']) {$device['os_group'] = $config['os'][$device['os']]['group']; echo("(".$device['os_group'].")");} + if($config['os'][$device['os']]['group']) + { + $device['os_group'] = $config['os'][$device['os']]['group']; + echo("(".$device['os_group'].")"); + } echo("\n"); unset($poll_update); unset($poll_update_query); unset($poll_separator); unset($version); unset($uptime); unset($features); @@ -278,7 +284,7 @@ while ($device = mysql_fetch_assoc($device_query)) } - ## FIX ME EVENTLOGGING + ## FIXME EVENTLOGGING ### This code cycles through the graphs already known in the database and the ones we've defined as being polled here ### If there any don't match, they're added/deleted from the database. ### Ideally we should hold graphs for xx days/weeks/polls so that we don't needlessly hide information. @@ -334,4 +340,4 @@ unset($config); ### Remove this for testing #print_r(get_defined_vars()); -?> +?> \ No newline at end of file