소스 검색

Merge branch 'master' of https://github.com/erdoking/mk_fhem

erdoking 7 년 전
부모
커밋
9231ab40a9
2개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 1
      README.md
  2. 7 2
      local/share/check_mk/agents/mk_fhem

+ 2 - 1
README.md

@@ -2,7 +2,8 @@
 
 check_MK Plugin für FHEM
 
-Getestet mit CheckMK 1.4.0p34 (Stand: 09.2018)
+Getestet mit CheckMK 1.5.0p6 (Stand: 10.2018)
+
 FHEM-Forum: https://forum.fhem.de/index.php/topic,63723.0.html
 
 ACHTUNG! In Version v0.9 hat sich die WATO Konfiguration massiv geändert, ältere WATO-Konfigurationen funktinieren nicht mehr und müssen neu erstellt werden!

+ 7 - 2
local/share/check_mk/agents/mk_fhem

@@ -74,9 +74,14 @@ foreach my $device (sort keys %devices ){
         foreach my $channel (sort keys %{$devices{$device}}){   
                 ## get device readings  
                 foreach my $reading (sort keys %{$devices{$device}{$channel}{Readings}}){
-                        if ( "$reading" !~ /RegL_\d+/) {
+                                
+                        ## trim value
+                        my $value = "$devices{$device}{$channel}{Readings}{$reading}{Value}";
+                        $value =~ s/^\s+|\s+$//g;
+                
+                        if (( "$reading" !~ /RegL_\d+/ ) and ( "$value" ne "" )) {
                                 ## e.g: $devices{eg.wz.thermostat}{Readings}{model} = HM-SEC-SCo
-                                printf("%-20s %-20s %-30s   %-20s %s\n","", $devices{$device}{$channel}{Readings}{$reading}{Time}, $channel, $reading, $devices{$device}{$channel}{Readings}{$reading}{Value});
+                                printf("%-20s %-20s %-30s   %-20s %s\n","", $devices{$device}{$channel}{Readings}{$reading}{Time}, $channel, $reading, $value);
                         }
                 }
         }