fix mempool polling. move removal of storage cache array to poll-device.php. perhaps this needs further aggregated elsewhere ?

git-svn-id: http://www.observium.org/svn/observer/trunk@1027 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong 2010-03-14 14:38:30 +00:00
parent 2d7ee29d10
commit a3495b015c
4 changed files with 6 additions and 3 deletions

View File

@ -7,7 +7,7 @@ if(!is_array($storage_cache['hrstorage'])) {
if ($debug) { print_r($storage_cache); }
} else { if($debug) { echo("Cached!"); } }
$entry = $storage_cache['hrstorage'][$device[device_id]][$mempool[index]];
$entry = $storage_cache['hrstorage'][$device[device_id]][$mempool[mempool_index]];
$mempool['units'] = $entry['hrStorageAllocationUnits'];
$mempool['used'] = $entry['hrStorageUsed'] * $mempool['units'];

View File

@ -52,6 +52,6 @@ while($storage = mysql_fetch_array($storage_data)) {
}
unset($storage_cache, $storage);
unset($storage);
?>

View File

@ -228,6 +228,8 @@ while ($device = mysql_fetch_array($device_query)) {
echo("No Changes to " . $device['hostname'] . "\n");
}
unset($storage_cache); // Clear cache of hrStorage ** MAYBE FIXME? **
$device_end = utime(); $device_run = $device_end - $device_start; $device_time = substr($device_run, 0, 5);
echo("Polled in $device_time seconds\n");

View File

@ -5,6 +5,7 @@ include("includes/defaults.inc.php");
include("config.php");
include("includes/functions.php");
$debug =1;
$poller_start = utime();
@ -59,6 +60,6 @@ $poller_end = utime(); $poller_run = $poller_end - $poller_start; $poller_time =
$string = $argv[0] . " " . 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."' >> /tmp/observer.log");
?>