32_SYSSTAT.pm: fix for snmp only mode

git-svn-id: https://svn.fhem.de/fhem/trunk@23949 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2021-03-13 16:03:40 +00:00
parent 4cedf4f3f3
commit 8fd498fca4

View File

@@ -139,10 +139,15 @@ SYSSTAT_Connect($)
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+5, "SYSSTAT_GetUpdate", $hash, 0);
return;
} elsif( AttrVal($name, "noSSH", undef ) ) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+5, "SYSSTAT_GetUpdate", $hash, 0);
return;
}
return undef if( AttrVal($name, "noSSH", undef ) );
return undef if( AttrVal($name, "disable", undef ) );
my @queue = ();
@@ -910,8 +915,8 @@ SYSSTAT_GetUpdate($)
if( AttrVal($name, "noSSH", undef) ) {
my @queue = ();
$hash->{QUEUE} = \@queue;
} elsif( !AttrVal($name, "noSSH", undef) && $hash->{QUEUE} && scalar @{$hash->{QUEUE}} ) {
} elsif( $hash->{QUEUE} && scalar @{$hash->{QUEUE}} ) {
Log3 $name, 2, "$name: unanswered query in queue, reconnecting";
SYSSTAT_Connect($hash);
return;
@@ -984,6 +989,10 @@ SYSSTAT_GetUpdateSNMP($)
return undef;
}
if(!$hash->{LOCAL}) {
return if( IsDisabled($name) > 0 );
}
SYSSTAT_getLoadAVGSNMP($hash);
SYSSTAT_getFilesystemsSNMP($hash) if( $hash->{do_diskusage} && $#{$hash->{filesystems}} >= 0 );