Hauptmenü

Fehlersuche mit apptime

Begonnen von MarvinLu, 14 März 2020, 12:32:56

Vorheriges Thema - Nächstes Thema

MarvinLu

Hallo zusammen,

seit einigen Wochen hängt mein fhem, zumindest die Oberfläche..
Alle Regelungen funktionieren ohne Probleme, lediglich der Zugriff hakt sehr oft..

"apptime max" schmeißt mir folgendes raus:
name                                     function                               max    count      total  average   maxDly   avgDly TS Max call     param Max call
logdb                                    DbLog_Get                            97845        5  198705.41 39741.08     0.00     0.00 14.03. 12:17:06 HASH(logdb); logdb; HISTORY; INT; 2020-03-14_00:00:00; 2020-03-14_23:59:59; thermometer_WZ:temperature; PID_WZ:desired; MAX_HT_WZ:valveposition; thermometer_WZ:humidity
myJeeLink                                JeeLink_Read                           662      193    7732.83    40.07     0.00     0.00 14.03. 12:18:20 HASH(myJeeLink)
logdb                                    DbLog_Log                              438      409    6475.75    15.83     0.00     0.00 14.03. 12:20:06 HASH(logdb); HASH(thermometer_Flur)
WEB_192.168.188.39_50773                 FW_Read                                220        3     252.25    84.08     0.00     0.00 14.03. 12:28:47 HASH(WEB_192.168.188.39_50773)
myFreezemon                              freezemon_Get                          175        1     175.15   175.15     0.00     0.00 14.03. 12:28:47 HASH(myFreezemon); myFreezemon; ?
Steckdose_Fernseher                      MQTT2_DEVICE_Set                       147        6     153.48    25.58     0.00     0.00 14.03. 12:15:28 HASH(Steckdose_Fernseher); Steckdose_Fernseher; ?
tmr-MQTT2_SERVER_keepaliveChecker        HASH(0x207d330)                        124       69     146.79     2.13 115117.79  2644.08 14.03. 12:17:28 HASH(m2s)
m2s_192.168.188.22_56409                 MQTT2_SERVER_Read                      118       29     325.79    11.23     0.00     0.00 14.03. 12:26:04 HASH(m2s_192.168.188.22_56409)
tmr-freezemon_ProcessTimer               HASH(0x43cb730)                        115      674     745.05     1.11 119277.27   299.81 14.03. 12:17:28 HASH(myFreezemon)
not_Handy_Marvin_online                  notify_Exec                            106       13    1292.28    99.41     0.00     0.00 14.03. 12:20:30 HASH(not_Handy_Marvin_online); HASH(FritzBox)
switch_Abwesenheit                       dummy_Set                              102       13    1253.11    96.39     0.00     0.00 14.03. 12:20:30 HASH(switch_Abwesenheit); switch_Abwesenheit; off
tmr-PID20_Calc                           PID_WZ                                  92       13     254.15    19.55 75364.92  5817.98 14.03. 12:17:28 PID_WZ
tmr-PID20_Calc                           PID_Kueche                              89       13     312.65    24.05 75777.00  5830.84 14.03. 12:21:28 PID_Kueche
tmr-PID20_Calc                           PID_Buero                               84       13     377.34    29.03 75465.34  5815.93 14.03. 12:25:28 PID_Buero
tmr-PID20_Calc                           PID_Flur                                79       13     459.33    35.33 75509.09  5811.53 14.03. 12:26:28 PID_Flur
tmr-Spotify_updatePlaybackStatus         HASH(0x4377c40)                         76       66     383.91     5.82 24105.81   367.50 14.03. 12:25:00 HASH(Spotify_client)
CUL_868_MAX                              CUL_Read                                74       40     747.41    18.69     0.00     0.00 14.03. 12:17:28 HASH(CUL_868_MAX)
doif_Waschmaschine_Sync                  DOIF_Notify                             67        6     135.43    22.57     0.00     0.00 14.03. 12:26:04 HASH(doif_Waschmaschine_Sync); HASH(Steckdose_Waschmaschine)
m2s_192.168.188.117_58850                MQTT2_SERVER_Read                       61       31     324.31    10.46     0.00     0.00 14.03. 12:18:57 HASH(m2s_192.168.188.117_58850)
tmr-PID20_Calc                           PID_Bad                                 61       13     264.78    20.37 75256.92  5802.18 14.03. 12:25:29 PID_Bad
m2s_192.168.188.24_63973                 MQTT2_SERVER_Read                       54       29     200.31     6.91     0.00     0.00 14.03. 12:21:19 HASH(m2s_192.168.188.24_63973)
m2s                                      MQTT2_SERVER_Read                       52       30     287.20     9.57     0.00     0.00 14.03. 12:18:23 HASH(m2s)
m2s_192.168.188.118_51922                MQTT2_SERVER_Read                       49       30     161.61     5.39     0.00     0.00 14.03. 12:25:57 HASH(m2s_192.168.188.118_51922)
not_humidity_Bad                         notify_Exec                             45       13     172.05    13.23     0.00     0.00 14.03. 12:17:29 HASH(not_humidity_Bad); HASH(thermometer_Bad)
thermostat_Bad                           dummy_Set                               43       22     310.97    14.13     0.00     0.00 14.03. 12:17:29 HASH(thermostat_Bad); thermostat_Bad; humidity; 48
not_temperature_Flur                     notify_Exec                             42       32     751.50    23.48     0.00     0.00 14.03. 12:20:56 HASH(not_temperature_Flur); HASH(thermometer_Flur)
not_temperature_Kueche                   notify_Exec                             41       16     360.11    22.51     0.00     0.00 14.03. 12:23:55 HASH(not_temperature_Kueche); HASH(thermometer_Kueche)
not_temperature_Bad                      notify_Exec                             41       13     198.84    15.30     0.00     0.00 14.03. 12:24:10 HASH(not_temperature_Bad); HASH(thermometer_Bad)
not_humidity_Flur                        notify_Exec                             39       32     504.02    15.75     0.00     0.00 14.03. 12:22:18 HASH(not_humidity_Flur); HASH(thermometer_Flur)
thermostat_Flur                          dummy_Set                               39       43    1108.16    25.77     0.00     0.00 14.03. 12:20:56 HASH(thermostat_Flur); thermostat_Flur; temperature; 19.4
not_humidity_Buero                       notify_Exec                             38       11      73.76     6.71     0.00     0.00 14.03. 12:23:47 HASH(not_humidity_Buero); HASH(thermometer_Buero)
thermostat_Kueche                        dummy_Set                               37       24     318.41    13.27     0.00     0.00 14.03. 12:23:55 HASH(thermostat_Kueche); thermostat_Kueche; temperature; 20
thermostat_Buero                         dummy_Set                               34       20     167.90     8.39     0.00     0.00 14.03. 12:23:47 HASH(thermostat_Buero); thermostat_Buero; humidity; 40
not_temperature_Buero                    notify_Exec                             34       11     154.62    14.06     0.00     0.00 14.03. 12:19:17 HASH(not_temperature_Buero); HASH(thermometer_Buero)
tmr-PID20_Calc                           PID_SZ                                  32       13     217.32    16.72 75436.18  5822.30 14.03. 12:17:28 PID_SZ
tmr-PRESENCE_StartLocalScan              HASH(0x2381ab8)                         31       69    1674.03    24.26 110157.71  2529.72 14.03. 12:24:28 HASH(Handy_Marvin)
m2s_192.168.188.23_54207                 MQTT2_SERVER_Read                       31       29     128.03     4.41     0.00     0.00 14.03. 12:21:13 HASH(m2s_192.168.188.23_54207)
not_temperature_SZ                       notify_Exec                             28       12      93.66     7.80     0.00     0.00 14.03. 12:18:20 HASH(not_temperature_SZ); HASH(thermometer_SZ)
thermostat_SZ                            dummy_Set                               26       21      73.49     3.50     0.00     0.00 14.03. 12:18:20 HASH(thermostat_SZ); thermostat_SZ; temperature; 19.2
tmr-FRITZBOX_Readout_Start               FritzBox.Readout                        25       13     229.28    17.64 75454.12  5835.83 14.03. 12:29:29 FritzBox.Readout
tmr-CUL_MAX_SendQueueHandler             HASH(0x26c2870)                         24       49     211.88     4.32 28894.21   593.85 14.03. 12:19:30 HASH(cm)


Ich weiß nicht, wo ich hier anfangen soll zu suchen und bin für jeden Tipp dankbar.
Versuche seit Anfang an dieses Problem bzw. die auftretenden Probleme zu identifizieren aber ich komme nicht dahinter..

Liebe Grüße und vielen Dank für die Hilfe!!
Marvin

KernSani

Ganz oben erscheint ein Temperaturplot, der ziemlich lange braucht.
Du hast freezemon am Laufen? Dann sollten die einzelnen Freezes dort vielleicht besser sichtbar sein


Gesendet von iPhone mit Tapatalk
RasPi: RFXTRX, HM, zigbee2mqtt, mySensors, JeeLink, miLight, squeezbox, Alexa, Siri, ...

DS_Starter

Ich gebe mal einen Tipp ab .... Marvin hat im FHEMWEB Device das Attribut plotfork bzw. plotEmbed nicht gesetzt.
Falls es so ist empfehle ich:

plotfork = 1
plotEmbed = 2

Wenn so gesetzt, braucht das System mehr Speicher wegen parallelen Prozessen, ist aber dadurch vor Blocking Situationen besser geschützt wenn die Plots aus der DB gelesen werden.

Btw ... im DbLog auch mal das Attribut asyncMode anschauen und ggf. setzen. Das hat was mit dem Schreiben in die DB zu tun. Und wenn du dabei bist auch gleich mal den set configCheck in deinem DbLog ausführen. Das Ergebnis gibt dir evtl. noch Hinweise.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

MarvinLu

Hallo zusammen,

vielen Dank DS_Starter!!
Wahnsinn was so 2 kleine Befehle bringen..
Läuft direkt wieder wie vor der Einrichtung des dblogs.. Klasse!

Hier noch die Ausgabe des configchecks:
Result of version check

Used Perl version: 5.24.1
Used DBI (Database independent interface) version: 1.636
Used DBD (Database driver) version SQLite: 1.54
Used DbLog version: 4.9.10.
Your local DbLog module is up to date.
Recommendation: No update of DbLog is needed.

Result of configuration read check

Connection parameter store type: file
Connection parameter: Connection -> SQLite:dbname=/opt/fhem/fhem.db, User -> , Password -> read o.k.

Result of connection check

Connection to database /opt/fhem/fhem.db successfully done.
Recommendation: settings o.k.

Result of encoding check

Encoding used by DB /opt/fhem/fhem.db: UTF-8
Recommendation: This is only an information about text encoding used by the main database.

Result of logmode check

Logmode of DbLog-device logdb is: asynchronous
Recommendation: settings o.k.

Result of insert mode check

Insert mode of DbLog-device logdb is: Bulk
Recommendation: settings o.k.

Result of plot generation method check

WEB: plotfork=1 / plotEmbed=2

Recommendation: settings o.k.

Result of table 'history' check

Column width set in DB history: 'DEVICE' = 32, 'TYPE' = 32, 'EVENT' = 512, 'READING' = 32, 'VALUE' = 32, 'UNIT' = 32
Column width used by logdb: 'DEVICE' = 64, 'TYPE' = 64, 'EVENT' = 512, 'READING' = 64, 'VALUE' = 128, 'UNIT' = 32
Recommendation: WARNING - The relation between column width in table history and the field width used by device logdb should be equal but it differs.The field width used by logdb can be adjusted by setting attributes 'colEvent', 'colReading', 'colValue'. (pls. refer to commandref)Because you use SQLite this is only a warning. Normally the database can handle these differences.

Result of table 'current' check

Column width set in DB current: 'DEVICE' = 32, 'TYPE' = 32, 'EVENT' = 512, 'READING' = 32, 'VALUE' = 32, 'UNIT' = 32
Column width used by logdb: 'DEVICE' = 64, 'TYPE' = 64, 'EVENT' = 512, 'READING' = 64, 'VALUE' = 128, 'UNIT' = 32
Recommendation: WARNING - The relation between column width in table current and the field width used by device logdb should be equal but it differs. The field width used by logdb can be adjusted by setting attributes 'colEvent', 'colReading', 'colValue'. (pls. refer to commandref)Because you use SQLite this is only a warning. Normally the database can handle these differences.

Result of check 'Search_Idx' availability

The index 'Search_Idx' is missing.
Recommendation: You can create the index by executing statement 'CREATE INDEX Search_Idx ON `history` (DEVICE, READING, TIMESTAMP)'
Depending on your database size this command may running a long time.
Please make sure the device 'logdb' is operating in asynchronous mode to avoid FHEM from blocking when creating the index.
Note: If you have just created another index which covers the same fields and order as suggested (e.g. a primary key) you don't need to create the 'Search_Idx' as well !


Result of check 'Report_Idx' availability for DbRep-devices

No DbRep-device assigned to log


Muss mir die letzten 4 Einträge mal genauer ansehen, da scheint es noch Optimierungspotenzial zu geben..

Hier nochmal die Ausgabe apptime max:
name                                     function                               max    count      total  average   maxDly   avgDly TS Max call     param Max call
tmr-PID20_Calc                           PID_Bad                               3778        9    3996.25   444.03    11.91     2.73 15.03. 11:09:37 PID_Bad
tmr-Spotify_updatePlaybackStatus         HASH(0x33a5930)                        379       57     666.44    11.69    55.12     2.48 15.03. 11:10:33 HASH(Spotify_client)
tmr-freezemon_ProcessTimer               HASH(0x33f9b80)                        265      531     736.97     1.39  3870.87    15.91 15.03. 11:09:27 HASH(myFreezemon)
LED_Strip_Bett                           EspLedController_Set                   144        1     144.43   144.43     0.00     0.00 15.03. 11:08:49 HASH(LED_Strip_Bett); LED_Strip_Bett; ?
telnetPort                               telnet_Read                            126       80     452.47     5.66     0.00     0.00 15.03. 11:10:35 HASH(telnetPort)
not_Handy_Marvin_online                  notify_Exec                             98        9     703.11    78.12     0.00     0.00 15.03. 11:10:06 HASH(not_Handy_Marvin_online); HASH(FritzBox)
switch_Abwesenheit                       dummy_Set                               95       12     677.63    56.47     0.00     0.00 15.03. 11:10:06 HASH(switch_Abwesenheit); switch_Abwesenheit; off
myJeeLink                                JeeLink_Read                            89      147    2460.75    16.74     0.00     0.00 15.03. 11:09:37 HASH(myJeeLink)
tmr-DOIF_TimerTrigger                    REF(0x3a593f8)                          85        1      85.88    85.88     1.98     1.98 15.03. 11:09:25 REF(0x3a593f8)
tmr-PID20_Calc                           PID_SZ                                  69        9     280.50    31.17  2178.07   243.25 15.03. 11:11:36 PID_SZ
m2s_192.168.188.22_57344                 MQTT2_SERVER_Read                       64       21     143.58     6.84     0.00     0.00 15.03. 11:10:44 HASH(m2s_192.168.188.22_57344)
tmr-PRESENCE_StartLocalScan              HASH(0x13adea0)                         53       52    1020.42    19.62     2.70     1.69 15.03. 11:09:59 HASH(Handy_Marvin)
tmr-PID20_Calc                           PID_Kueche                              49        9     224.10    24.90  2127.04   246.93 15.03. 11:15:36 PID_Kueche
tmr-DOIF_SleepTrigger                    HASH(0x2930788)                         49        1      49.00    49.00     1.50     1.50 15.03. 11:15:44 HASH(doif_Waschmaschine_Status)
doif_Waschmaschine_Sync                  DOIF_Notify                             42        4      44.38    11.10     0.00     0.00 15.03. 11:10:44 HASH(doif_Waschmaschine_Sync); HASH(Steckdose_Waschmaschine)
CUL_868_MAX                              CUL_Read                                40       35     357.45    10.21     0.00     0.00 15.03. 11:09:15 HASH(CUL_868_MAX)
m2s_192.168.188.24_61194                 MQTT2_SERVER_Read                       40       22     128.23     5.83     0.00     0.00 15.03. 11:10:40 HASH(m2s_192.168.188.24_61194)
tmr-PID20_Calc                           PID_Flur                                34        9     159.06    17.67  2119.35   255.73 15.03. 11:15:36 PID_Flur
m2s_192.168.188.118_60853                MQTT2_SERVER_Read                       33       21     106.11     5.05     0.00     0.00 15.03. 11:16:03 HASH(m2s_192.168.188.118_60853)
tmr-DbLog_execmemcache                   HASH(0x2a29b28)                         30       17     405.51    23.85  3691.96   229.94 15.03. 11:12:38 HASH(logdb)
tmr-PID20_Calc                           PID_Buero                               29        9     129.88    14.43  3782.98   433.06 15.03. 11:11:37 PID_Buero
m2s_192.168.188.117_54538                MQTT2_SERVER_Read                       28       22     118.18     5.37     0.00     0.00 15.03. 11:12:29 HASH(m2s_192.168.188.117_54538)
m2s_192.168.188.23_56219                 MQTT2_SERVER_Read                       27       22     102.34     4.65     0.00     0.00 15.03. 11:15:52 HASH(m2s_192.168.188.23_56219)
tmr-CUL_MAX_SendQueueHandler             HASH(0x16ef090)                         23       56     261.63     4.67  3440.63    64.41 15.03. 11:12:37 HASH(cm)
gassistant                               gassistant_Read                         22       85     116.65     1.37     0.00     0.00 15.03. 11:09:11 HASH(gassistant)
tmr-FRITZBOX_Readout_Start               FritzBox.Readout                        21        9     171.52    19.06     2.86     2.28 15.03. 11:12:01 FritzBox.Readout
not_temperature_Buero                    notify_Exec                             21        9      67.55     7.51     0.00     0.00 15.03. 11:09:40 HASH(not_temperature_Buero); HASH(thermometer_Buero)
CUL_868_MAX                              CUL_Get                                 20       13     167.46    12.88     0.00     0.00 15.03. 11:12:37 HASH(CUL_868_MAX); CUL_868_MAX; credit10ms
not_humidity_SZ                          notify_Exec                             19       11      86.35     7.85     0.00     0.00 15.03. 11:09:24 HASH(not_humidity_SZ); HASH(thermometer_SZ)
MAX_HT_SZ                                MAX_Set                                 19        5      52.58    10.52     0.00     0.00 15.03. 11:11:36 HASH(MAX_HT_SZ); MAX_HT_SZ; maxValveSetting; 30
Status_Waschmaschine                     dummy_Set                               19        2      19.41     9.70     0.00     0.00 15.03. 11:15:44 HASH(Status_Waschmaschine); Status_Waschmaschine; off
not_humidity_Kueche                      notify_Exec                             19       20     223.97    11.20     0.00     0.00 15.03. 11:09:29 HASH(not_humidity_Kueche); HASH(thermometer_Kueche)
doif_monitoring_Pushover                 DOIF_Notify                             18      266     158.70     0.60     0.00     0.00 15.03. 11:10:40 HASH(doif_monitoring_Pushover); HASH(Steckdose_Computer)
3D_Drucker                               MQTT2_DEVICE_Set                        18        1      18.28    18.28     0.00     0.00 15.03. 11:08:50 HASH(3D_Drucker); 3D_Drucker; ?
Bettsteckdose_rechts                     MQTT2_DEVICE_Set                        18        1      18.26    18.26     0.00     0.00 15.03. 11:08:50 HASH(Bettsteckdose_rechts); Bettsteckdose_rechts; ?
Steckdose_Fernseher                      MQTT2_DEVICE_Set                        18        1      18.20    18.20     0.00     0.00 15.03. 11:08:50 HASH(Steckdose_Fernseher); Steckdose_Fernseher; ?
E_Zigarette                              MQTT2_DEVICE_Set                        18        1      18.17    18.17     0.00     0.00 15.03. 11:08:50 HASH(E_Zigarette); E_Zigarette; ?
Steckdose_Waschmaschine                  MQTT2_DEVICE_Set                        18        1      18.17    18.17     0.00     0.00 15.03. 11:08:50 HASH(Steckdose_Waschmaschine); Steckdose_Waschmaschine; ?
Steckdose_Computer                       MQTT2_DEVICE_Set                        18        1      18.09    18.09     0.00     0.00 15.03. 11:08:50 HASH(Steckdose_Computer); Steckdose_Computer; ?
not_temperature_Kueche                   notify_Exec                             17       20     178.53     8.93     0.00     0.00 15.03. 11:09:29 HASH(not_temperature_Kueche); HASH(thermometer_Kueche)
MAX_HT_Bad                               MAX_Set                                 17        8      31.61     3.95     0.00     0.00 15.03. 11:09:33 HASH(MAX_HT_Bad); MAX_HT_Bad; maxValveSetting; 96


Wenn euch noch was auffällt, was ich optimieren kann, immer her :-)

Liebe Grüße und schicken Sonntag,
Marv

DS_Starter

Hallo Marvin,

ist schon mal sehr schön.  :)
Jetzt kommt das ABER ... einen sehr wichtigen Faktor hat dir der configCheck rausgebracht:

Zitat
The index 'Search_Idx' is missing.
Recommendation: You can create the index by executing statement 'CREATE INDEX Search_Idx ON `history` (DEVICE, READING, TIMESTAMP)'
Depending on your database size this command may running a long time.
Please make sure the device 'logdb' is operating in asynchronous mode to avoid FHEM from blocking when creating the index.
Note: If you have just created another index which covers the same fields and order as suggested (e.g. a primary key) you don't need to create the 'Search_Idx' as well !

Das ist die Ursache warum deine DB so lahm ist. Der Index ist sehr,sehr,sehr wichtig um schnell Daten lesen zu können.
Du solltest ihn unbedingt anlegen. Der Befehl steht dabei den du in einem SQL-Editor absetzen kannst.
Alternativ kannst du dir gleich mal ein DbRep-Device einrichten. Wenn getan kannst du mit


set <DbRep-Device> index recreate_Search_Idx


diesen Index mit FHEM-MItteln leicht anlegen lassen. Außerdem bietet dir DbRep noch viel mehr in Bezug auf Datenbankbenutzung. Unter anderem auch ein Backup der SQLite DB in laufenden Betrieb.

Ein Backup der DB ist Pflicht wenn man seine Daten sicher haben und nicht verlieren will !!!

Die anderen Warnungen bzgl. "Column width " sind bei SQLite eher ein Hinweis weil diese DB normalerweise damit kein Problem hat. Willst du es sauber haben, verwende die attribute 'colEvent', 'colReading', 'colValue'. Alternativ müsstest du die Tabellen neu (nach dem aktuellen Schema) anlegen. Geht bei SQLite nicht anders glaube ich.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

MarvinLu

Ehm eine etwas peinliche Frage..
Wo genau muss ich den Befehl absetzen?
Ich habe mit SQL-Datenbanken bisher nicht gearbeitet..

DS_Starter

#6
Das macht du auf Betriebssystemebene in dem Verzeichnis wo deine DB liegt. Wenn das File "fhem.db" im Verzeichnis "/opt" heißt, würdest du es so machen:


cd /opt
heiko@fhemtest:/opt$ sqlite3 fhem.db
heiko@fhemtest:/opt$ sqlite3 fhem.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite> CREATE INDEX Search_Idx ON `history` (DEVICE, READING, TIMESTAMP);
sqlite> .exit;


Wie gesagt, einfacher ist es gleich ein DbRep-Device zu definieren und den oben angegebenen set-Befehl zu benutzen.
Vermutlich brauchst du es früher oder später sowieso wenn du "auf den Geschmack" gekommen bist.  ;)
Außerdem ist die Prozedur über DbRep selbst auch wieder Non-blocking.

LG,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

MarvinLu

#7
Hallo Heiko,

ich habs wie vorgeschlagen mit dem device versucht.

Der scheint aber irgendwie Probleme mit dem Zugriff zu haben..

Ich hab ihm vorher die Login-Daten für meine Oberfläche mitgegeben:
set DbRep_device adminCredentials <user fhem> <pw>

2020.03.15 15:19:14 3: DbRep DbRep_device - ################################################################
2020.03.15 15:19:14 3: DbRep DbRep_device - ###                    New Index operation                   ###
2020.03.15 15:19:14 3: DbRep DbRep_device - ################################################################
2020.03.15 15:19:14 3: DbRep DbRep_device - Command: index recreate_Search_Idx
2020.03.15 15:19:14 2: DbRep DbRep_device - user "" doesn't have rights "INDEX" and "ALTER" as needed - try use adminCredentials automatically !
2020.03.15 15:19:15 3: DbRep DbRep_device - Index found in database:

2020.03.15 15:19:15 3: DbRep DbRep_device - Index Search_Idx doesn't exist, no need to drop it
2020.03.15 15:19:15 3: DbRep DbRep_device - creating index Search_Idx ...
2020.03.15 15:19:45 2: DbLog logdb -> Error table history - DBD::SQLite::st execute failed: database is locked at ./FHEM/93_DbLog.pm line 2415.


EDIT:

Jetzt läuft es! :-)

Result of check 'Search_Idx' availability

Index 'Search_Idx' exists and contains recommended fields 'DEVICE', 'READING', 'TIMESTAMP'.
Recommendation: settings o.k.

Result of check 'Report_Idx' availability for DbRep-devices

Index 'Report_Idx' exists and contains recommended fields 'TIMESTAMP', 'READING'.
Recommendation: settings o.k.


Vielen Dank Heiko für deine Hilfe!!

Die Apptime sieht auch schon viel besser aus:
tmr-Spotify_updatePlaybackStatus         HASH(0x4b49358)                        182      169     892.68     5.28    90.79     3.29 15.03. 15:38:30 HASH(Spotify_client)
not_Handy_Marvin_online                  notify_Exec                             79       19    1331.54    70.08     0.00     0.00 15.03. 15:53:19 HASH(not_Handy_Marvin_online); HASH(FritzBox)
switch_Abwesenheit                       dummy_Set                               76       18    1283.45    71.30     0.00     0.00 15.03. 15:53:19 HASH(switch_Abwesenheit); switch_Abwesenheit; off
myJeeLink                                JeeLink_Read                            68      394    5313.20    13.49     0.00     0.00 15.03. 15:38:23 HASH(myJeeLink)
tmr-PID20_Calc                           PID_SZ                                  65       20     384.58    19.23    41.18     3.82 15.03. 15:40:07 PID_SZ
tmr-PID20_Calc                           PID_Flur                                61       20     407.00    20.35     2.05     1.58 15.03. 15:51:07 PID_Flur
m2s_192.168.188.22_62835                 MQTT2_SERVER_Read                       53       48     256.18     5.34     0.00     0.00 15.03. 15:47:32 HASH(m2s_192.168.188.22_62835)
tmr-PID20_Calc                           PID_Bad                                 49       19     483.44    25.44    42.98     4.60 15.03. 15:55:09 PID_Bad
tmr-PID20_Calc                           PID_WZ                                  47       19     417.79    21.99    52.46     9.12 15.03. 15:52:09 PID_WZ
tmr-DOIF_SleepTrigger                    HASH(0x287c360)                         45        1      45.97    45.97     1.99     1.99 15.03. 15:44:09 HASH(di_Abschaltautomatik_Ezig)
tmr-PID20_Calc                           PID_Kueche                              42       20     424.13    21.21    53.84     4.24 15.03. 15:40:07 PID_Kueche
m2s_192.168.188.117_51222                MQTT2_SERVER_Read                       39       47     237.52     5.05     0.00     0.00 15.03. 15:49:43 HASH(m2s_192.168.188.117_51222)
m2s_192.168.188.118_54804                MQTT2_SERVER_Read                       37       48     256.92     5.35     0.00     0.00 15.03. 15:43:09 HASH(m2s_192.168.188.118_54804)
tmr-PID20_Calc                           PID_Buero                               34       19     279.45    14.71    60.43    14.49 15.03. 15:40:09 PID_Buero
tmr-DbLog_execmemcache                   HASH(0x41cd640)                         32       39     910.89    23.36    19.16     1.85 15.03. 15:41:09 HASH(logdb)
doif_Waschmaschine_Sync                  DOIF_Notify                             30        8      35.16     4.40     0.00     0.00 15.03. 15:47:32 HASH(doif_Waschmaschine_Sync); HASH(Steckdose_Waschmaschine)
m2s_192.168.188.23_55113                 MQTT2_SERVER_Read                       29       47     228.18     4.85     0.00     0.00 15.03. 15:52:51 HASH(m2s_192.168.188.23_55113)
m2s_192.168.188.24_51320                 MQTT2_SERVER_Read                       28       48     236.52     4.93     0.00     0.00 15.03. 15:52:29 HASH(m2s_192.168.188.24_51320)
MAX_HT_Flur                              MAX_Set                                 27        2      37.12    18.56     0.00     0.00 15.03. 15:51:07 HASH(MAX_HT_Flur); MAX_HT_Flur; maxValveSetting; 1
tmr-PRESENCE_StartLocalScan              HASH(0x2b531f8)                         24      118    2419.09    20.50    17.67     1.98 15.03. 15:54:25 HASH(Handy_Marvin)
MAX_HT_SZ                                MAX_Set                                 24        1      24.27    24.27     0.00     0.00 15.03. 15:40:07 HASH(MAX_HT_SZ); MAX_HT_SZ; maxValveSetting; 0
CUL_868_MAX                              CUL_Read                                23       57     453.92     7.96     0.00     0.00 15.03. 15:53:18 HASH(CUL_868_MAX)
tmr-FRITZBOX_Readout_Start               FritzBox.Readout                        23       19     396.58    20.87     2.70     2.14 15.03. 15:45:16 FritzBox.Readout
tmr-CUL_MAX_SendQueueHandler             HASH(0x2e90bc0)                         23       80     252.90     3.16    25.14     2.28 15.03. 15:39:15 HASH(cm)
CUL_868_MAX                              CUL_Get                                 20       18     221.61    12.31     0.00     0.00 15.03. 15:40:07 HASH(CUL_868_MAX); CUL_868_MAX; credit10ms
E_Zigarette                              MQTT2_DEVICE_Set                        19        1      19.31    19.31     0.00     0.00 15.03. 15:44:09 HASH(E_Zigarette); E_Zigarette; off
not_temperature_Kueche                   notify_Exec                             19       32     331.58    10.36     0.00     0.00 15.03. 15:45:34 HASH(not_temperature_Kueche); HASH(thermometer_Kueche)
not_humidity_Flur                        notify_Exec                             16       18     137.51     7.64     0.00     0.00 15.03. 15:38:23 HASH(not_humidity_Flur); HASH(thermometer_Flur)
not_temperature_WZ                       notify_Exec                             15       36     410.73    11.41     0.00     0.00 15.03. 15:38:27 HASH(not_temperature_WZ); HASH(thermometer_WZ)
not_temperature_SZ                       notify_Exec                             15       22     188.26     8.56     0.00     0.00 15.03. 15:53:24 HASH(not_temperature_SZ); HASH(thermometer_SZ)
thermostat_Kueche                        dummy_Set                               15       45     253.72     5.64     0.00     0.00 15.03. 15:45:34 HASH(thermostat_Kueche); thermostat_Kueche; temperature; 20.2
not_temperature_Bad                      notify_Exec                             14       22     194.97     8.86     0.00     0.00 15.03. 15:50:24 HASH(not_temperature_Bad); HASH(thermometer_Bad)
MAX_HT_Bad                               MAX_Set                                 14        4      57.60    14.40     0.00     0.00 15.03. 15:50:09 HASH(MAX_HT_Bad); MAX_HT_Bad; maxValveSetting; 8
di_Abschaltautomatik_Ezig                DOIF_Notify                             14        9      31.12     3.46     0.00     0.00 15.03. 15:44:09 HASH(di_Abschaltautomatik_Ezig); HASH(E_Zigarette)
not_temperature_Buero                    notify_Exec                             14       18     128.03     7.11     0.00     0.00 15.03. 15:48:46 HASH(not_temperature_Buero); HASH(thermometer_Buero)
MAX_HT_WZ                                MAX_Set                                 13        4      35.14     8.79     0.00     0.00 15.03. 15:44:09 HASH(MAX_HT_WZ); MAX_HT_WZ; maxValveSetting; 27
thermostat_Flur                          dummy_Set                               13       31      97.85     3.16     0.00     0.00 15.03. 15:38:23 HASH(thermostat_Flur); thermostat_Flur; humidity; 48
thermostat_SZ                            dummy_Set                               12       34     139.25     4.10     0.00     0.00 15.03. 15:53:24 HASH(thermostat_SZ); thermostat_SZ; temperature; 19
thermostat_WZ                            dummy_Set                               12       49     320.42     6.54     0.00     0.00 15.03. 15:38:27 HASH(thermostat_WZ); thermostat_WZ; temperature; 20.4
doif_Heizplan_Bad                        DOIF_Notify                             11       18     199.27    11.07     0.00     0.00 15.03. 15:53:18 HASH(doif_Heizplan_Bad); HASH(switch_Abwesenheit)
doif_Heizplan_Kueche                     DOIF_Notify                             11       18     194.36    10.80     0.00     0.00 15.03. 15:45:18 HASH(doif_Heizplan_Kueche); HASH(switch_Abwesenheit)

DS_Starter

#8
Sehr schön Marvin  :)

Ich muss nur nochmal nach den Logmeldungen schauen. Bei SQLite dürften die nicht kommen.
Aber das ist eine Kleinigkeit.

EDIT: erledigt und neue DbRep-Version morgen früh im Update.

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

MarvinLu

Perfekt, vielen Dank!!

Liebe Grüße, Marvin

tlasrich

Zitat von: MarvinLu am 15 März 2020, 15:21:36
Hallo Heiko,

ich habs wie vorgeschlagen mit dem device versucht.

Der scheint aber irgendwie Probleme mit dem Zugriff zu haben..

Ich hab ihm vorher die Login-Daten für meine Oberfläche mitgegeben:
set DbRep_device adminCredentials <user fhem> <pw>

2020.03.15 15:19:14 3: DbRep DbRep_device - ################################################################
2020.03.15 15:19:14 3: DbRep DbRep_device - ###                    New Index operation                   ###
2020.03.15 15:19:14 3: DbRep DbRep_device - ################################################################
2020.03.15 15:19:14 3: DbRep DbRep_device - Command: index recreate_Search_Idx
2020.03.15 15:19:14 2: DbRep DbRep_device - user "" doesn't have rights "INDEX" and "ALTER" as needed - try use adminCredentials automatically !
2020.03.15 15:19:15 3: DbRep DbRep_device - Index found in database:

2020.03.15 15:19:15 3: DbRep DbRep_device - Index Search_Idx doesn't exist, no need to drop it
2020.03.15 15:19:15 3: DbRep DbRep_device - creating index Search_Idx ...
2020.03.15 15:19:45 2: DbLog logdb -> Error table history - DBD::SQLite::st execute failed: database is locked at ./FHEM/93_DbLog.pm line 2415.


EDIT:

Jetzt läuft es! :-)

Result of check 'Search_Idx' availability

Index 'Search_Idx' exists and contains recommended fields 'DEVICE', 'READING', 'TIMESTAMP'.
Recommendation: settings o.k.

Result of check 'Report_Idx' availability for DbRep-devices

Index 'Report_Idx' exists and contains recommended fields 'TIMESTAMP', 'READING'.
Recommendation: settings o.k.


Vielen Dank Heiko für deine Hilfe!!

Ich habe nun das gleiche Problem, ich bekomme bei dem Versuch einen Index anzulegen immer die Meldung, dass der User nicht die erforderlichen Rechte besitzt.

Was hast Du gemacht, das es auf einmal funktionierte?

DS_Starter

ZitatWas hast Du gemacht, das es auf einmal funktionierte?
Er hatte (im März) auf die aktuellste DbRep Version geupdated. Mach das bitte auch und dann mit:

set <DbRep_device> adminCredentials <user> <pw>

DbRep einen adminstrativen Datenbankuser mitteilen, üblicherweise root (Datenbankuser!). Bei SQLite ncht nötig bzw. möglich !

Danach ein:

set <DbRep_device> index recreate_Search_Idx

Grüße,
Heiko
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

tlasrich

Hallo,

danke für die schnelle Antwort. Laut FHEM habe ich folgende Version des Moduls installiert: 93_DbRep.pm:v8.40.5-s22492/2020-07-29.

Andere Operationen funktionieren augenscheinlich, nur wenn ich versuche einen Index anzulegen, egal ob search oder report, erhalte ich folgende Meldung:

DbRep repdb - ################################################################
2020.07.31 15:45:21 3: DbRep repdb - ###                    New Index operation                   ###
2020.07.31 15:45:21 3: DbRep repdb - ################################################################
2020.07.31 15:45:21 3: DbRep repdb - Command: index recreate_Search_Idx
2020.07.31 15:45:21 2: DbRep repdb - user "fhem" doesn't have rights "INDEX" and "ALTER" as needed - try use adminCredentials automatically !


Ich habe es sowohl mit root als auch dem fhem User ausprobiert. In beiden Fällen erhalte ich obige Ausgabe. Mindestens Root besitzt die erforderlichen Rechte.

Hat noch jemand eine Idee?

Gruß

Thorsten

DS_Starter

Die Ausgabe sagt erstmal nur dass der user "fhem" nicht die erforderlichen Rechte hat und das Modul adminCredentials automatisch versucht zu benutzen.
Mit root sollte das dann funktionieren (die Meldung kommt trotzdem). Den Index zu erstellen braucht üblicherweise etwas Zeit.
Deswegen setze dir das Attribut useAdminCredentials. Dann sollte das passen ohne dass diese Meldung oben kommt.
ESXi@NUC+Debian+MariaDB, PV: SMA, Victron MPII+Pylontech+CerboGX
Maintainer: SSCam, SSChatBot, SSCal, SSFile, DbLog/DbRep, Log2Syslog, SolarForecast,Watches, Dashboard, PylonLowVoltage
Kaffeekasse: https://www.paypal.me/HMaaz
Contrib: https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter

tlasrich

#14
Zitat von: DS_Starter am 31 Juli 2020, 16:02:33
Die Ausgabe sagt erstmal nur dass der user "fhem" nicht die erforderlichen Rechte hat und das Modul adminCredentials automatisch versucht zu benutzen.
Mit root sollte das dann funktionieren (die Meldung kommt trotzdem). Den Index zu erstellen braucht üblicherweise etwas Zeit.
Deswegen setze dir das Attribut useAdminCredentials. Dann sollte das passen ohne dass diese Meldung oben kommt.

Gibt es hinsichtlich des Passwortes Einschränkungen bei der Verwendung von Sonderzeichen? Das Passwort habe ich in einfache Anführungszeichen gesetzt, ich hoffe das war in Ordnung oder werden diese nun als Teil des Passworts interpretiert?

UPDATE: Neues Passwort ohne Sonderzeichen und neu einlesen der db-Config für das dblog-Device haben mein Problem gelöst. Offenbar sind nicht alle Sonderzeichen als Passwort möglich.

Gruß
Thorsten