refactor: only run pre-cache for the current OS (#6453)

Change powerwalker to use the $pre_cache array
This commit is contained in:
Tony Murray
2017-04-18 16:26:58 -05:00
committed by Neil Lathwood
parent 2ced131cf5
commit c88c677a16
17 changed files with 54 additions and 79 deletions

View File

@@ -3,7 +3,14 @@
$valid['sensor'] = array();
// Pre-cache data for later use
require 'includes/discovery/sensors/pre-cache.inc.php';
$pre_cache = array();
$pre_cache_file = 'includes/discovery/sensors/pre-cache/' . $device['os'] . '.inc.php';
if (is_file($pre_cache_file)) {
echo "Pre-cache {$device['os']}: ";
include $pre_cache_file;
echo PHP_EOL;
d_echo($pre_cache);
}
// Run custom sensors
require 'includes/discovery/sensors/cisco-entity-sensor.inc.php';