mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fix: availability cpu/kernel_max
git-svn-id: https://svn.fhem.de/fhem/trunk@6731 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
af82486e6f
commit
4e176e2dc9
@ -30,7 +30,7 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
my $VERSION = "1.9.3";
|
my $VERSION = "1.9.3.1";
|
||||||
|
|
||||||
use constant {
|
use constant {
|
||||||
PERL_VERSION => "perl_version",
|
PERL_VERSION => "perl_version",
|
||||||
@ -927,13 +927,16 @@ SYSMON_getCPUCoreNum($)
|
|||||||
|
|
||||||
return $sys_cpu_core_num if $sys_cpu_core_num;
|
return $sys_cpu_core_num if $sys_cpu_core_num;
|
||||||
|
|
||||||
my $str = SYSMON_execute($hash, "cat /sys/devices/system/cpu/kernel_max");
|
# nur wenn verfuegbar
|
||||||
if(defined($str)) {
|
if(SYSMON_isSysCpuNum($hash)) {
|
||||||
if($str ne "") {
|
my $str = SYSMON_execute($hash, "cat /sys/devices/system/cpu/kernel_max");
|
||||||
if(int($str)!=0) {
|
if(defined($str)) {
|
||||||
$sys_cpu_core_num = int($str)+1;
|
if($str ne "") {
|
||||||
return $sys_cpu_core_num;
|
if(int($str)!=0) {
|
||||||
}
|
$sys_cpu_core_num = int($str)+1;
|
||||||
|
return $sys_cpu_core_num;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2419,6 +2422,17 @@ SYSMON_isSysPowerBat($) {
|
|||||||
return $sys_power_bat;
|
return $sys_power_bat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $sys_cpu_num = undef;
|
||||||
|
sub
|
||||||
|
SYSMON_isSysCpuNum($) {
|
||||||
|
my ($hash) = @_;
|
||||||
|
if(!defined $sys_cpu_num) {
|
||||||
|
$sys_cpu_num = int(SYSMON_execute($hash, "[ -f /sys/devices/system/cpu/kernel_max ] && echo 1 || echo 0"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $sys_cpu_num;
|
||||||
|
}
|
||||||
|
|
||||||
sub SYSMON_PowerAcInfo($$)
|
sub SYSMON_PowerAcInfo($$)
|
||||||
{
|
{
|
||||||
#online, present, current_now (/1000 =>mA), voltage_now (/1000000 => V)
|
#online, present, current_now (/1000 =>mA), voltage_now (/1000000 => V)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user