mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 18:38:25 +00:00
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:
parent
2d7ee29d10
commit
a3495b015c
@ -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'];
|
||||
|
@ -52,6 +52,6 @@ while($storage = mysql_fetch_array($storage_data)) {
|
||||
|
||||
}
|
||||
|
||||
unset($storage_cache, $storage);
|
||||
unset($storage);
|
||||
|
||||
?>
|
||||
|
@ -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");
|
||||
|
||||
|
@ -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");
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user