Skip to content

Commit 3a57ffc

Browse files
committed
Remove polling pre-cache
1 parent 6f4a335 commit 3a57ffc

File tree

5 files changed

+8
-75
lines changed

5 files changed

+8
-75
lines changed

includes/polling/functions.inc.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ function bulk_sensor_snmpget($device, $sensors)
3434
return $cache;
3535
}
3636

37-
/**
38-
* @param $device
39-
* @param string $type type/class of sensor
40-
* @return array
41-
*/
42-
function sensor_precache($device, $type)
43-
{
44-
$sensor_cache = [];
45-
if (file_exists(LibrenmsConfig::get('install_dir') . '/includes/polling/sensors/pre-cache/' . $device['os'] . '.inc.php')) {
46-
include LibrenmsConfig::get('install_dir') . '/includes/polling/sensors/pre-cache/' . $device['os'] . '.inc.php';
47-
}
48-
49-
return $sensor_cache;
50-
}
51-
5237
function poll_sensor($device, $class)
5338
{
5439
$sensors = [];
@@ -67,8 +52,6 @@ function poll_sensor($device, $class)
6752

6853
$snmp_data = bulk_sensor_snmpget($device, $sensors);
6954

70-
$sensor_cache = sensor_precache($device, $class);
71-
7255
foreach ($sensors as $sensor) {
7356
Log::info('Checking (' . $sensor['poller_type'] . ") $class " . $sensor['sensor_descr'] . '... ');
7457

includes/polling/sensors/pre-cache/aos-emu2.inc.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

includes/polling/sensors/pre-cache/geist-watchdog.inc.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

includes/polling/sensors/temperature/aos-emu2.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,7 @@
2323
* @copyright 2016 Neil Lathwood
2424
* @author Neil Lathwood <neil@lathwood.co.uk>
2525
*/
26-
$sensor_value = fahrenheit_to_celsius($sensor_value, $sensor_cache['scale']);
26+
27+
$scale = SnmpQuery::cache()->get('PowerNet-MIB::emsStatusSysTempUnits.0')->value();
28+
29+
$sensor_value = fahrenheit_to_celsius($sensor_value, $scale);

includes/polling/sensors/temperature/geist-watchdog.inc.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
* @copyright 2017 Neil Lathwood
2424
* @author Neil Lathwood <gh+n@laf.io>
2525
*/
26-
if ($sensor_cache['geist_temp_unit'] === '0') {
26+
27+
$temp_unit = SnmpQuery::cache()->get('GEIST-V4-MIB::temperatureUnits.0')->value();
28+
29+
if ($temp_unit === '0') {
2730
$sensor_value = fahrenheit_to_celsius($sensor_value / 10) * 10;
2831
}

0 commit comments

Comments
 (0)