mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Extract ASUS like motherboards CPU fans and temp data
https://sourceforge.net/p/webadmin/discussion/600155/thread/1b4ee640c6/
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user