mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 06:48:43 +00:00
bugfix: warnings
git-svn-id: https://svn.fhem.de/fhem/trunk@8998 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
85e9038ee5
commit
731b763b0b
@ -38,7 +38,7 @@ use Data::Dumper;
|
||||
my $missingModulRemote;
|
||||
eval "use Net::Telnet;1" or $missingModulRemote .= "Net::Telnet ";
|
||||
|
||||
my $VERSION = "2.2.5";
|
||||
my $VERSION = "2.2.6";
|
||||
|
||||
use constant {
|
||||
PERL_VERSION => "perl_version",
|
||||
@ -2672,7 +2672,7 @@ sub SYSMON_getNetworkInfo ($$$) {
|
||||
#--- DEBUG ---
|
||||
|
||||
# check if network available
|
||||
if (index($dataThroughput[0], 'Fehler') < 0 && index($dataThroughput[0], 'error') < 0)
|
||||
if (defined($dataThroughput[0]) && index($dataThroughput[0], 'Fehler') < 0 && index($dataThroughput[0], 'error') < 0)
|
||||
{
|
||||
#Log 3, "SYSMON>>>>>>>>>>>>>>>>> OK >>>".$dataThroughput[0];
|
||||
my $dataThroughput = undef;
|
||||
@ -2727,12 +2727,12 @@ sub SYSMON_getNetworkInfo ($$$) {
|
||||
# if(-e "/sys/class/net/$nName/statistics/rx_bytes" && -e "/sys/class/net/$nName/statistics/tx_bytes") {
|
||||
if(SYSMON_isNetStatClass($hash, $nName)) {
|
||||
$rxRaw = SYSMON_execute($hash, "cat /sys/class/net/$nName/statistics/rx_bytes");
|
||||
$rxRaw = -1 unless defined $rxRaw;
|
||||
$rxRaw = -1 unless (defined($rxRaw) && looks_like_number($rxRaw));
|
||||
$txRaw = SYSMON_execute($hash, "cat /sys/class/net/$nName/statistics/tx_bytes");
|
||||
$txRaw = -1 unless defined $txRaw;
|
||||
$txRaw = -1 unless (defined($txRaw) && looks_like_number($txRaw));
|
||||
}
|
||||
|
||||
if($rxRaw<0||$txRaw<0) {
|
||||
|
||||
if($rxRaw<0||$txRaw<0) {
|
||||
if(defined $dataThroughput) {
|
||||
# remove RX bytes or TX bytes from string
|
||||
$dataThroughput =~ s/RX bytes://;
|
||||
|
Loading…
x
Reference in New Issue
Block a user