Merge pull request #1632 from maykoli/dev/fix-sensors-fan-info

Fix sensors fans info parsing missing
This commit is contained in:
Jamie Cameron
2022-05-07 12:08:57 -07:00
committed by GitHub

View File

@@ -510,6 +510,13 @@ if (&has_command("sensors")) {
my ($cpu_fan_num, $cpu_fan_rpm) = $_ =~ /(?|fan([\d+])\s*:\s+([0-9]+)\s+rpm|cpu(\s)fan\s*:\s+([0-9]+)\s+rpm|cpu\s+fan\s*:\s+([0-9]+)\s+rpm)/i;
$cpu++ if ($cpu_volt || $cpu_fan_num);
# First just store fan data for any device if any
push(@fans,
{ 'fan' => &trim($cpu_fan_num),
'rpm' => $cpu_fan_rpm
}
) if ($cpu_fan_num);
# CPU package
($cpu_package) = $_ =~ /(?|(package\s+id\s+[\d]+)|(coretemp-[a-z]+-[\d]+))/i
if (!$cpu_package);
@@ -549,13 +556,6 @@ if (&has_command("sensors")) {
($cpu_broadcom) = $_ =~ /cpu_thermal-virtual-[\d]+/i if (!$cpu_broadcom);
($cpu_amd) = $_ =~ /\w[\d]{2}temp-pci/i if (!$cpu_amd);
# First just store fan data for any device if any
push(@fans,
{ 'fan' => &trim($cpu_fan_num),
'rpm' => $cpu_fan_rpm
}
) if ($cpu_fan_num);
# Full CPU output #1253
if ($cpu) {