mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-08 05:15:10 +00:00
32_SYSSTAT.pm: uptime fix by reibuehl, see forum: https://forum.fhem.de/index.php/topic,10573.msg941455.html#msg941455
git-svn-id: https://svn.fhem.de/fhem/trunk@19418 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d43f294de3
commit
1b9d0c5704
@ -629,6 +629,19 @@ SYSSTAT_getUptime($)
|
||||
$uptime += $minutes;
|
||||
$uptime *= 60;
|
||||
$uptime += $seconds;
|
||||
|
||||
} elsif( $uptime && $uptime =~ m/(\d+)\s\D+,\s(\d+):(\d+).\d+/ ) {
|
||||
my $hours = $1;
|
||||
my $minutes = $2;
|
||||
my $seconds = $3;
|
||||
|
||||
$uptime = 0;
|
||||
$uptime += $hours;
|
||||
$uptime *= 60;
|
||||
$uptime += $minutes;
|
||||
$uptime *= 60;
|
||||
$uptime += $seconds;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -637,7 +650,6 @@ SYSSTAT_getUptime($)
|
||||
|
||||
my $uptime = SYSSTAT_readFile($hash,"/proc/uptime","");
|
||||
if($uptime) {
|
||||
|
||||
$uptime = $1 if ( $uptime && $uptime =~ /^\s*([0-9.]+)\s+([0-9.]+)/ );
|
||||
|
||||
if( AttrVal($name, "uptime", 0) != 2 ) {
|
||||
@ -736,6 +748,7 @@ SYSSTAT_getStat($)
|
||||
|
||||
=pod
|
||||
=item device
|
||||
=item summary system statistics for the host FHEM runs on or a remote system
|
||||
=begin html
|
||||
|
||||
<a name="SYSSTAT"></a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user