mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
32_SYSSTAT.pm: don't fill load and state if values are not available
git-svn-id: https://svn.fhem.de/fhem/trunk@23970 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cacc29cdae
commit
f2f3079405
@ -1151,17 +1151,18 @@ SYSSTAT_getLoadAVGSNMP($ )
|
|||||||
|
|
||||||
if( !$response ) {
|
if( !$response ) {
|
||||||
my $response = SYSSTAT_readOIDs($hash,'.1.3.6.1.2.1.25.3.3.1.2');
|
my $response = SYSSTAT_readOIDs($hash,'.1.3.6.1.2.1.25.3.3.1.2');
|
||||||
my $avg = '';
|
my $avg;
|
||||||
my %lavg = ();
|
my %lavg = ();
|
||||||
my $load = 0;
|
my $load;
|
||||||
foreach my $key (keys %{$response}) {
|
foreach my $key (keys %{$response}) {
|
||||||
$avg .= ',' if( $avg ne '' );
|
$avg .= ',' if( $avg );
|
||||||
$avg .= $response->{$key};
|
$avg .= $response->{$key};
|
||||||
|
$load = 0 if( !$load );
|
||||||
$load += $response->{$key} / 100;
|
$load += $response->{$key} / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
$hash->{BlockingResult}{state} = $avg;
|
$hash->{BlockingResult}{state} = $avg if( defined($avg) );
|
||||||
$hash->{BlockingResult}{load} = $load;
|
$hash->{BlockingResult}{load} = $load if( defined($load) );
|
||||||
#readingsBulkUpdate($hash, 'state', $avg) if( $avg );
|
#readingsBulkUpdate($hash, 'state', $avg) if( $avg );
|
||||||
#readingsBulkUpdate($hash, 'load', $load) if( $load );
|
#readingsBulkUpdate($hash, 'load', $load) if( $load );
|
||||||
return undef;
|
return undef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user