diff --git a/docs/assets/images/checkmk/long_check_output.png b/docs/assets/images/checkmk/long_check_output.png new file mode 100644 index 000000000..e30563d63 Binary files /dev/null and b/docs/assets/images/checkmk/long_check_output.png differ diff --git a/docs/assets/images/checkmk/no_updates_available.png b/docs/assets/images/checkmk/no_updates_available.png new file mode 100644 index 000000000..b32aa619b Binary files /dev/null and b/docs/assets/images/checkmk/no_updates_available.png differ diff --git a/docs/assets/images/checkmk/updates_available.png b/docs/assets/images/checkmk/updates_available.png new file mode 100644 index 000000000..d948cd1d7 Binary files /dev/null and b/docs/assets/images/checkmk/updates_available.png differ diff --git a/docs/manual-guides/checkmk/u_e-checkmk.de.md b/docs/manual-guides/checkmk/u_e-checkmk.de.md new file mode 100644 index 000000000..22f52d76c --- /dev/null +++ b/docs/manual-guides/checkmk/u_e-checkmk.de.md @@ -0,0 +1,50 @@ +Mailcow bietet mittels dem eigenen Update-Script die Möglichkeit zu prüfen ob Updates vorhanden sind. + +Sofern mailcow-Updates mittels checkmk abgefragt werden soll, kann man im `local`-Verzeichnis des checkmk-Agents (normalerweise `/usr/lib/check_mk_agent/local/`) eine ausführbare Datei mit dem Namen `mailcow_update` und nachfolgendem Inhalt erstellen: + +```` +#!/bin/bash +cd /opt/mailcow-dockerized/ && ./update.sh -c >/dev/null +status=$? +if [ $status -eq 3 ]; then + echo "0 \"mailcow_update\" mailcow_update=0;1;;0;1 No updates available." +elif [ $status -eq 0 ]; then + echo "1 \"mailcow_update\" mailcow_update=1;1;;0;1 Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" +else + echo "3 \"mailcow_update\" - Unknown output from update script ..." +fi +exit +```` + +Sofern das mailcow-Installationsverzeichnis nicht `/opt/` ist, ist das in der 2. Zeile anzupassen. + +Danach für euren mailcow-Host in checmk die Services neu inventarisieren und es sollte ein neuer Check mit Namen `mailcow_update` auswählbar sein. + +## Screenshots + +### Keine Updates verfügbar + +Sofern keine Updates vorhanden sind, wird `OK` ausgegeben. + +![No update available](../../assets/images/checkmk/no_updates_available.png) + +### Neue Updates verfügbar + +Sofern Updates vorhanden sind, wird `WARN` ausgegeben. + +![Updates available](../../assets/images/checkmk/updates_available.png) + +Sollte stattdessen `CRIT` gewünscht sein, ist die 7. Zeile durch folgendes zu ersetzen: + +```` + echo "1 \"mailcow_update\" mailcow_update=1;1;;0;1 Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" +```` + +### Detailierter Check-Output + +![Long check output](../../assets/images/checkmk/long_check_output.png) + +- Hier wird ein Link zu den GitHub Commits von mailcow ausgegeben, sofern Updates verfügbar sind. +- Metriken werden ebenfalls ausgegeben (nicht nur bei vorhandenen Updates): + - 0 = Keine Updates verfügbar + - 1 = Neue Updates verfügbar diff --git a/docs/manual-guides/checkmk/u_e-checkmk.en.md b/docs/manual-guides/checkmk/u_e-checkmk.en.md new file mode 100644 index 000000000..6089264af --- /dev/null +++ b/docs/manual-guides/checkmk/u_e-checkmk.en.md @@ -0,0 +1,50 @@ +Mailcow provides the ability to check for updates using its own update script. + +If you want to check for mailcow updates using checkmk, you can create an executable file in the `local` directory of the checkmk agent (typically `/usr/lib/check_mk_agent/local/`) with the name `mailcow_update` and the following content: + +```` +#!/bin/bash +cd /opt/mailcow-dockerized/ && ./update.sh -c >/dev/null +status=$? +if [ $status -eq 3 ]; then + echo "0 \"mailcow_update\" mailcow_update=0;1;;0;1 No updates available." +elif [ $status -eq 0 ]; then + echo "1 \"mailcow_update\" mailcow_update=1;1;;0;1 Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" +else + echo "3 \"mailcow_update\" - Unknown output from update script ..." +fi +exit +```` + +If the mailcow installation directory is not `/opt/`, adjust this in the 2nd line. + +After that re-inventory the services for your mailcow host in checmk and a new check named `mailcow_update` should be selectable. + +## Screenshots + +### No updates available + +If there are no updates available, `OK` is displayed. + +![No update available](../../assets/images/checkmk/no_updates_available.png) + +### New updates available + +If updates are available, `WARN` is displayed. + +![Updates available](../../assets/images/checkmk/updates_available.png) + +If `CRIT` is desired instead, replace the 7th line with the following: + +```` + echo "1 \"mailcow_update\" mailcow_update=1;1;;0;1 Updated code is available.\nThe changes can be found here: https://github.com/mailcow/mailcow-dockerized/commits/master" +```` + +### Detailed check output + +![Long check output](../../assets/images/checkmk/long_check_output.png) + +- This provides a link to mailcow's GitHub commits, if updates are available. +- Metrics are also displayed ( not only when updates are available): + - 0 = No updates available + - 1 = New updates available