FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: rasti am 01 März 2020, 15:44:56

Titel: NMAP - Readingsgroup blockiert FHEM
Beitrag von: rasti am 01 März 2020, 15:44:56
Hallo,

ich habe ein Problem mit einer Readingsgroup, die mein FHEM für 30-40 Sekunden lahmlegt.

Hier das Ergebnis von apptime :

name             function    max  count    total  average maxDly
                           nmapListe readingsGroup_Notify  36589    657    36787    55.99      0 HASH(nmapListe); HASH(Netzwerk)
                           Mosquitto           MQTT::Read   9033     26    15755   605.96      0 HASH(Mosquitto)
            WEB_192.168.178.54_62048              FW_Read   7860     10    11316  1131.60      0 HASH(WEB_192.168.178.54_62048)
                      FileLog_sysmon          FileLog_Get   6479      7    23468  3352.57      0 HASH(FileLog_sysmon); FileLog_sysmon; CURRENT; INT; 2020-03-01_00:00:00; 2020-03-02_00:00:01; 4:cpu_temp_avg\x3a:0:; 4:cpu_temp\x3a:0:; 4:cpu_freq\x3a:0:
                    tmr-OWX_Discover      HASH(0x3ccbd98)   5208      1     5208  5208.00    901 HASH(OneWireAdapter)
            WEB_192.168.178.54_62089              FW_Read   4940     23     6890   299.57      0 HASH(WEB_192.168.178.54_62089)
             tmr-CUL_HM_updateConfig         updateConfig   3066      1     3066  3066.00   9105 updateConfig
            FileLog_Mess_Steckdose_2          FileLog_Get   2433      1     2433  2433.00      0 HASH(FileLog_Mess_Steckdose_2); FileLog_Mess_Steckdose_2; CURRENT; INT; 2020-03-01_00:00:00; 2020-03-02_00:00:01; 4:Mess_Steckdose_2.ENERGY_Power\x3a::; 4:Mess_Steckdose_2.ENERGY_Total\x3a::
                   tmr-CUL_HM_procQs        CUL_HM_procQs   1869      7     2630   375.71  22602 CUL_HM_procQs
            FileLog_Mess_Steckdose_3          FileLog_Get   1856      1     1856  1856.00      0 HASH(FileLog_Mess_Steckdose_3); FileLog_Mess_Steckdose_3; CURRENT; INT; 2020-03-01_00:00:00; 2020-03-02_00:00:01; 4:Mess_Steckdose_3.ENERGY_Power\x3a::; 4:Mess_Steckdose_3.ENERGY_Total\x3a::
                     FileLog_Cryptoz          FileLog_Get   1648      1     1648  1648.00      0 HASH(FileLog_Cryptoz); FileLog_Cryptoz; CURRENT; INT; 2020-03-01_00:00:00; 2020-03-02_00:00:01; 4:Wallet.amount\x3a::; 4:IOTA.iota\x3a::($fld[3]*100); 4:VERGE.verge\x3a::($fld[3]*1000); 4:RIPPLE.ripple\x3a::($fld[3]*100)
               tmr-OWTHERM_GetValues      HASH(0x3f0ff28)   1403      2     2591  1295.50  10314 HASH(Temperatur_Puffer_unten)
               tmr-OWTHERM_GetValues      HASH(0x3bd6d58)   1401      2     2588  1294.00   7516 HASH(Temperatur_Puffer_Mitte)
               tmr-OWTHERM_GetValues      HASH(0x3f52cd0)   1401      2     2611  1305.50   6117 HASH(Temperatur_Keller)
               tmr-OWTHERM_GetValues      HASH(0x3cebdc8)   1400      2     2586  1293.00   8916 HASH(Temperatur_Puffer_oben)
               tmr-OWTHERM_GetValues      HASH(0x3dcf1a0)   1400      2     2587  1293.50  13113 HASH(Temperatur_Solar_Kollektor_Vorlauf)
               tmr-OWTHERM_GetValues      HASH(0x3f92228)   1400      2     2589  1294.50  11715 HASH(Temperatur_Solar_Kollektor_Ruecklauf)
               tmr-rssFeed_GetUpdate      HASH(0x2e27218)   1315      1     1315  1315.00  13317 HASH(ecuadorNews)
                            WLAN_CUL             CUL_Read   1245      4     1577   394.25      0 HASH(WLAN_CUL)
             tmr-ONKYO_AVR_GetStatus      HASH(0x30f2c78)   1202      8     2355   294.38  16899 HASH(Amplifier)
            FileLog_Mess_Steckdose_1          FileLog_Get   1140      1     1140  1140.00      0 HASH(FileLog_Mess_Steckdose_1); FileLog_Mess_Steckdose_1; CURRENT; INT; 2020-03-01_00:00:00; 2020-03-02_00:00:01; 4:Mess_Steckdose_1.ENERGY_Total\x3a::; 4:Mess_Steckdose_1.ENERGY_Power\x3a::


Wenn man die Readingsgroup nmapListe aus fhem.cfg rausnimmt (und nur das nmap-Modul ohne readingsgroup läuft ),
läuft fhem normal. ist also nicht das nmap-Modul, sondern wirklich die Readingsgroup.

Hier die Config:

define nmapListe readingsGroup <>,<Nr>,<IP-Adresse>,<online>,<RechnerName>,<Uptime>,<Last Seen>,<MAC> Netzwerk:@4,#1_ip,<#1>,#1_state,(.*)_alias,#1_uptimeText,#1_lastSeen,#1_macAddress
attr nmapListe alias Home-Netzwerk
attr nmapListe cellStyle { "c:1" => 'style="text-align:right"',"c:3" => 'style="text-align:center"',"c:4" => 'style="text-align:left"' }
attr nmapListe icon it_network
attr nmapListe room 1__Netzwerk
attr nmapListe sortColumn 2
attr nmapListe valueFormat { \
if ($VALUE eq 'absent') { "<img src='./fhem/images/default/WLAN_Status.0.png' alt='absent'>"  }\
  elsif ($VALUE eq 'present') {"<img src='./fhem/images/default/WLAN_Status.1.png' alt='present'>" }\
  elsif (substr($READING,rindex($READING,"_")) eq "_ip") { substr($VALUE,rindex($VALUE,".")+1)  } \
  else {  ""  }\
}\

attr nmapListe valueStyle {$READING =~ m/(.+)_/;;\
my $state = ReadingsVal($DEVICE, $1."_state", "NA");;\
my $style = "";;\
\
return('style="text-align: right;; '.$style.'"') if($state eq "present" && $READING =~ m/_uptime/);;\
return('style="color: #FF0000;; text-align: right;; '.$style.'"') if($state eq "absent" && $READING =~ m/_uptime/);;\
\
return('style="'.$style.'"') if($state eq "present");;\
return('style="color: #FF0000;; '.$style.'"') if($state eq "absent");;\
}



Woran liegt das lange Timeout, ist mein Rechner (raspi 1) dazu einfach zu lahm ?
Es sind 30-35 Devices

Viele Grüße

Ralf