Reporting / rrd - fix regression in 895e58ff25, missing rrd target and sysctl collection issue. partially merges https://github.com/opnsense/core/pull/8024

This commit is contained in:
Ad Schellevis 2024-10-31 08:35:54 +01:00
parent 33fcdabdbb
commit 8e3b4b7229
2 changed files with 3 additions and 2 deletions

View File

@ -33,10 +33,10 @@ class Temperature extends Base
public function run()
{
$data = $this->shellCmd(
'/sbin/sysctl -n dev.cpu.0.temperature hw.acpi.thermal.tz0.temperature hw.temperature.CPU'
'/sbin/sysctl -ni dev.cpu.0.temperature hw.acpi.thermal.tz0.temperature hw.temperature.CPU'
);
if (!empty($data)) {
return [$data[0]];
return [preg_replace('/[^0-9,.]/', '', $data[0])];
}
return [];
}

View File

@ -36,6 +36,7 @@ class Temperature extends Base
protected int $ds_heartbeat = 120;
protected int $ds_min = -273;
protected int $ds_max = 5000;
protected static string $stdfilename = 'system-cputemp.rrd';
/**
* {@inheritdoc}