From 8e3b4b7229e487e844cbc2dbaf58369b3ffcd081 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 31 Oct 2024 08:35:54 +0100 Subject: [PATCH] Reporting / rrd - fix regression in https://github.com/opnsense/core/commit/895e58ff251e36fb52935c7a754c0299b8046c76, missing rrd target and sysctl collection issue. partially merges https://github.com/opnsense/core/pull/8024 --- .../scripts/health/library/OPNsense/RRD/Stats/Temperature.php | 4 ++-- .../scripts/health/library/OPNsense/RRD/Types/Temperature.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opnsense/scripts/health/library/OPNsense/RRD/Stats/Temperature.php b/src/opnsense/scripts/health/library/OPNsense/RRD/Stats/Temperature.php index 059d9a165..950078d6f 100755 --- a/src/opnsense/scripts/health/library/OPNsense/RRD/Stats/Temperature.php +++ b/src/opnsense/scripts/health/library/OPNsense/RRD/Stats/Temperature.php @@ -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 []; } diff --git a/src/opnsense/scripts/health/library/OPNsense/RRD/Types/Temperature.php b/src/opnsense/scripts/health/library/OPNsense/RRD/Types/Temperature.php index ebdceb929..4f8b8c6be 100755 --- a/src/opnsense/scripts/health/library/OPNsense/RRD/Types/Temperature.php +++ b/src/opnsense/scripts/health/library/OPNsense/RRD/Types/Temperature.php @@ -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}