====== Healthcheck ====== LoxBerry provides a healthcheck tool to test important system functions of your LoxBerry. Navigate to the //My LoxBerry// widget / //Healthcheck//. {{konfiguration:widget_help:widget_my_loxberry:1234403341.png?w=500}}  On any issues using LoxBerry or a plugin, first run the healthcheck. With the //Download// button you can download the results as a text file to submit it to the developers. //Please check and remove any privacy information before submitting the text file in a public forum.// From your feedback and issues reported, we will integrate further checks in the future. ====== Running the healthcheck from command line ====== First login to your LoxBerry using putty ([[haufig_gestellte_fragen_faq:eine_sshverbindung_mit_putty_aufbauen_shellzugriff|Eine SSH-Verbindung mit putty aufbauen / Shell-Zugriff]]) In the shell, run ''%%/opt/loxberry/sbin/healthcheck.pl%%'' The results are listed in text form. {{konfiguration:widget_help:widget_my_loxberry:1234403342.png?w=350}} ====== Running the healthcheck from emergency webserver ====== If the standard WebUI of LoxBerry isn't available anymore, you can reach the healthcheck also from LoxBerry's emergency webserver: **''%%http://%%''''%%:%%''''%%64995%%''''%%/live_%%''''%%healthcheck%%''** The results are listed in text form. {{konfiguration:widget_help:widget_my_loxberry:1269957750.png?h=250}} ====== Daily automatic healthcheck ====== LoxBerry runs an automatic daily healthcheck of your LoxBerry in the background. In the case that an error occurs, a notification is triggered and displayed in the Healthcheck widget. If you have your [[konfiguration:widget_help:widget_mail_server|Mailserver]] settings defined, the notification is also sent by email. The notification is triggered every time the error count changes, and additionally, it is repeated every week. Warnings do not trigger a notification. ====== Healthcheck status via MQTT ====== //(available from LoxBerry 2.2)// LoxBerry publishes the status of every single healthcheck, and a summary of all healthchecks, via MQTT, if the [[plugins:mqtt_gateway:start|MQTT Gateway]] plugin is installed. Every healthcheck has it's own topic. The data of the check are submitted in json format (the MQTT Gateway will expand these json data). The summary contains the numbers of errors, warnings and ok's, as well as the update time, also as part of a json. Topic per Healthcheck: **/healthcheck/** Summary topic: **/healthcheck/summary** ===== Subscription examples ===== * To subscribe the full healthcheck in MQTT Gateway, add a subscription to **''%%/healthcheck/#%%''** * To subscribe the healthcheck in MQTT Gateway for multiple LoxBerry's, add a subscription to **''%%+/healthcheck/#%%''** * To only subscribe the healthcheck summary, subscribe to **''%%/healthcheck/summary%%''** * To subscribe to a specific healthcheck, subscribe to **''%%/healthcheck/%%''** The data of each healthcheck, and the summary contain: ^Property ^Description ^ |status |0/empty...UNKNOWN, 3...ERROR, 4...Warning, 5...OK, 6...Info | |statustext |The above status as text | |result |The result text provided by the check | |Summary | | |errors |Error count (Status unknown is also counted as error) | |infos |Info count | |ok |OK count | |unknown |Unknown count | |warnings |Warnings count | |lastupdate |Time of last update in human readable format | |lastupdateepoch|Time of last update in Unix epoch | Check the MQTT Gateway Incoming Overview. ====== Getting a healthcheck summary to Loxone Miniserver ====== LoxBerry provides the data of the daily healthcheck as a json data resultset, that can be queried by a **Virtual HTTP Input** in your Miniserver. The dataset request url is:  ''%%http://:@/admin/system/healthcheck.cgi?action=summary%%'' Alternative dataset request url (which does not use the internal Apache webserver): ''%%http://%%''''%%:%%''''%%64995%%''/''%%healthcheck%%'' ( and are your LoxBerry username and password) Example resultset: {"warnings_and_errors":1,"ok":6,"timeepoch":1558954739,"infos":2,"unknown":0,"errors":0,"warnings":1,"timelox":328193939} To query the healthcheck data: * Create a Virtual HTTP Input using the above url. Set the update interval to e.g. 21.000 seconds (~6 hours). * Create Virtual HTTP Input Commands with command recognition: * ''%%"timeepoch":\v%%'' * ''%%"timelox":\v%%'' * ''%%"errors":\v%%'' * Set the commands //not to be// digital inputs. * You may add also ''%%warnings%%'' or ''%%warnings_and_errors%%'' if you like ''%%timeepoch%%'' is the last run in Unix time. Use the suggested circuit from [[https://loxwiki.atlassian.net/wiki/spaces/LOX/pages/1522696392|epochtime (Unix-Zeit) zum Prüfen auf Datenaktualität nutzen]] (German only) and a Switch Off Delay (DE: "Ausschaltverzögerung") with a delay of 108.000 seconds (30 hours). If the timestamp updates within 30 hours, the Switch Off Delay stays ON. If the output of the Switch Off Delay goes to OFF, the timestamp seems not to be updated, and LoxBerry may have an error. The ''%%timelox%%'' input is the last run in Loxone time. In the "View" settings in the input properties, set ''%%%%'' to show the last update time in human readable format. For ''%%errors%%'', ''%%warnings%%'',... add custom circuits as you like. === Update interval === Calling the url //does not// run the check on-the-fly. The data are updated daily by the automatic healthcheck. The update interval of the healthcheck is between 18 and 30 hours (randomly delayed).   LoxBerry's own healthcheck only provides data once a day to reduce load on your LoxBerry and your Miniserver. If an important plugin provides it's own heartbeat/healthcheck, you may (also) use that to monitor your plugin.