From 80409416356b0ed727bf2ccb7d0af62cc18f2327 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 11 Nov 2009 16:02:58 +0000 Subject: [PATCH] updates and cleanups. fixed mysql query git-svn-id: http://www.observium.org/svn/observer/trunk@514 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/functions.php | 3 ++- includes/polling/hr-mib_processor.inc.php | 2 +- poll-device.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 2a378feec..e067c4260 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -91,7 +91,8 @@ function shorthost($hostname, $len=16) { function rrdtool_update($rrdfile, $rrdupdate) { global $config; - echo($config['rrdtool'] . " update $rrdfile $rrdupdate \n"); + global $debug; + if($debug) { echo($config['rrdtool'] . " update $rrdfile $rrdupdate \n"); } return shell_exec($config['rrdtool'] . " update $rrdfile $rrdupdate"); } diff --git a/includes/polling/hr-mib_processor.inc.php b/includes/polling/hr-mib_processor.inc.php index af24a4273..5e16c69b6 100755 --- a/includes/polling/hr-mib_processor.inc.php +++ b/includes/polling/hr-mib_processor.inc.php @@ -12,7 +12,7 @@ while ($hrDevice = mysql_fetch_array($query)) { $this_hrDevice = $hrDevice_array[$device[device_id]][$hrDevice[hrDeviceIndex]]; $update_query = "UPDATE `hrDevice` SET"; - $update_query .= ", `hrDeviceStatus` = '".mres($this_hrDevice['hrDeviceStatus'])."'"; + $update_query .= " `hrDeviceStatus` = '".mres($this_hrDevice['hrDeviceStatus'])."'"; $update_query .= ", `hrDeviceErrors` = '".mres($this_hrDevice['hrDeviceErrors'])."'"; $update_query .= ", `hrProcessorLoad` = '".mres($this_hrDevice['hrProcessorLoad'])."'"; $update_query .= " WHERE hrDevice_id = '".$hrDevice['hrDevice_id']."'"; diff --git a/poll-device.php b/poll-device.php index 46a5c24a6..a5fed82aa 100755 --- a/poll-device.php +++ b/poll-device.php @@ -280,7 +280,7 @@ $poller_end = utime(); $poller_run = $poller_end - $poller_start; $poller_time = $string = $argv[0] . " $doing " . date("F j, Y, G:i") . " - $i devices polled in $poller_time secs"; echo("$string\n"); -shell_exec("echo '".$string."' >> /opt/observer/observer.log"); +shell_exec("echo '".$string."' >> ".$config['install_dir']."/observer.log"); ?>