From a18bf52ce0ad5146aa84886a1253620ac1301745 Mon Sep 17 00:00:00 2001 From: Ilia Rostovtsev Date: Mon, 29 Nov 2021 19:48:35 +0300 Subject: [PATCH] Extract ASUS like motherboards CPU fans and temp data https://sourceforge.net/p/webadmin/discussion/600155/thread/1b4ee640c6/ --- proc/linux-lib.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/proc/linux-lib.pl b/proc/linux-lib.pl index 0937e6970..d02719fd2 100755 --- a/proc/linux-lib.pl +++ b/proc/linux-lib.pl @@ -505,8 +505,8 @@ if (&has_command("sensors")) { while (<$fh>) { # CPU full output must have either voltage or fan data - my ($cpu_volt) = $_ =~ /in[\d+]:\s+([\+\-0-9\.]+)\s+V/i; - my ($cpu_fan_num, $cpu_fan_rpm) = $_ =~ /(?|fan([\d+]):\s+([0-9]+)\s+rpm|cpu(\s)fan:\s+([0-9]+)\s+rpm)/i; + my ($cpu_volt) = $_ =~ /(?|in[\d+]\s*:\s+([\+\-0-9\.]+)\s+V|cpu\s+core\s+voltage\s*:\s+([0-9\.]+)\s+V)/i; + 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); # CPU package @@ -519,8 +519,8 @@ if (&has_command("sensors")) { # Common CPU multi if (/Core\s+(\d+):\s+([\+\-][0-9\.]+)/) { - # Prioritise package core temperature - # data over motherboard but keep fans + # Prioritise package core temperature + # data over motherboard but keep fans @cpu = (), $cpu_aux++ if ($cpu_aux & 1 && grep { $_->{'core'} eq $1 } @cpu); push(@cpu, @@ -567,7 +567,8 @@ if (&has_command("sensors")) { } # Approx from motherboard sensor as last resort - elsif (/(cputin|cpu\stemp):\s+([\+][0-9\.]+).*?[Cc]\s+.*?[=+].*?\)/i) { + elsif (/(cputin|cpu\s+temp)\s*:\s+([\+][0-9\.]+).*?[Cc]\s+.*?[=+].*?\)/i || + /(cpu\s+temperature)\s*:\s+([\+][0-9\.]+).*?[Cc]/i) { push(@cpu, { 'core' => 0, 'temp' => int($2)