2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

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:
justme-1968 2021-03-13 16:03:40 +00:00
parent 7522b18e2e
commit dd827885c6

View File

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