2
0
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:
hexenmeister 2014-10-09 20:08:15 +00:00
parent af82486e6f
commit 4e176e2dc9

View File

@ -30,7 +30,7 @@ package main;
use strict;
use warnings;
my $VERSION = "1.9.3";
my $VERSION = "1.9.3.1";
use constant {
PERL_VERSION => "perl_version",
@ -927,6 +927,8 @@ SYSMON_getCPUCoreNum($)
return $sys_cpu_core_num if $sys_cpu_core_num;
# nur wenn verfuegbar
if(SYSMON_isSysCpuNum($hash)) {
my $str = SYSMON_execute($hash, "cat /sys/devices/system/cpu/kernel_max");
if(defined($str)) {
if($str ne "") {
@ -936,6 +938,7 @@ SYSMON_getCPUCoreNum($)
}
}
}
}
# Default / unbekannt
$sys_cpu_core_num = 1;
@ -2419,6 +2422,17 @@ SYSMON_isSysPowerBat($) {
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($$)
{
#online, present, current_now (/1000 =>mA), voltage_now (/1000000 => V)