Compare commits
4
Commits
8ad4a5cbd9
...
c98caaaf35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c98caaaf35 | ||
|
|
2d645bcc0b | ||
|
|
4bbd1de4f6 | ||
|
|
3dd59fb973 |
+15
-1
@@ -94,6 +94,15 @@ TZ=Europe/Berlin
|
||||
# NGINX PROXY MANAGER (HTTPS: Let's Encrypt ODER selbstsigniert)
|
||||
# =====================================================================
|
||||
# Ebenfalls vollqualifiziert - siehe Hinweis oben zu Podman!
|
||||
# Soll der Proxy-Manager-Container ueberhaupt betrieben werden?
|
||||
# on = wird gebaut und gestartet (Vorgabe)
|
||||
# off = wird weder angelegt noch gestartet - sinnvoll, wenn die
|
||||
# HTTPS-Terminierung ein bereits vorhandener NGINX auf einem
|
||||
# anderen System uebernimmt. Der leitet dann auf Port 5000 weiter.
|
||||
# Die Daten unter ./data/npm bleiben beim Abschalten erhalten.
|
||||
# Umschalten ueber das Menue oder: ./scripts/cmk-manage.sh npm-enable off
|
||||
NPM_ENABLED=on
|
||||
|
||||
NPM_IMAGE=docker.io/jc21/nginx-proxy-manager:2
|
||||
NPM_CONTAINER_NAME=nginx-proxy-manager
|
||||
NPM_DISABLE_IPV6=true
|
||||
@@ -135,8 +144,13 @@ CMK_DATA_DIR=./data/checkmk/sites
|
||||
NPM_DATA_DIR=./data/npm/data
|
||||
NPM_LE_DIR=./data/npm/letsencrypt
|
||||
|
||||
# Ablage fuer Backups / Migrations-Bundles und heruntergeladene Images
|
||||
# Ablage fuer MANUELLE Backups und Migrations-Bundles.
|
||||
# Geplante Jobs bringen ihr eigenes Zielverzeichnis mit (backup-jobs.conf).
|
||||
BACKUP_DIR=./backups
|
||||
|
||||
# Sollen die Backup-Jobs automatisch per cron laufen?
|
||||
# Umschalten ueber das Menue oder: ./scripts/cmk-manage.sh job auto on
|
||||
BACKUP_AUTO=off
|
||||
IMAGE_DIR=./images
|
||||
|
||||
# =====================================================================
|
||||
|
||||
@@ -13,3 +13,6 @@ backups/*
|
||||
*.log
|
||||
images/*
|
||||
!images/.gitkeep
|
||||
backup-jobs.conf
|
||||
scripts/.h.sh
|
||||
scripts/.harness.sh
|
||||
|
||||
@@ -127,7 +127,7 @@ werden müssen.
|
||||
| 80/tcp | NGINX Proxy Manager – HTTP, Let's-Encrypt-Challenge | Internet/LAN |
|
||||
| 443/tcp | NGINX Proxy Manager – HTTPS | Internet/LAN |
|
||||
| 81/tcp | NGINX Proxy Manager – **Adminoberfläche** (Vorgabe; per [`npm-port`](#12-adminoberfläche-auf-einen-anderen-port-legen) änderbar) | nur Admin-Netz! |
|
||||
| 5000/tcp | Checkmk Apache (Backend) | **nur localhost** – nicht freigeben |
|
||||
| 5000/tcp | Checkmk Apache (Backend) | **nur localhost** – nicht freigeben. Ausnahme: bei abgeschaltetem Proxy Manager ([12.4](#124-proxy-manager-ganz-abschalten-externer-nginx)) nur für die IP des externen Proxys |
|
||||
| 8000/tcp | Checkmk Agent-Receiver (TLS-registrierte Agents) | überwachte Hosts |
|
||||
| 6557/tcp | Livestatus (nur bei `CMK_LIVESTATUS_TCP=on`) | verteilte Sites |
|
||||
|
||||
@@ -550,9 +550,11 @@ Die wichtigsten Schalter:
|
||||
| `CMK_LIVESTATUS_TCP` | `on` öffnet Port 6557 für verteilte Überwachung |
|
||||
| `MAIL_RELAY_HOST` | SMTP-Relay für Benachrichtigungen |
|
||||
| `TZ` | Zeitzone, z. B. `Europe/Berlin` |
|
||||
| `NPM_ENABLED` | `on`/`off` – soll der Proxy-Manager-Container überhaupt laufen? Siehe [12.4](#124-proxy-manager-ganz-abschalten-externer-nginx) |
|
||||
| `NPM_ADMIN_PORT` | Port der Proxy-Manager-Oberfläche (Vorgabe 81) – nur über `npm-port` bzw. das Menü ändern |
|
||||
| `NPM_ADMIN_URL` | Startseite des Terminal-Browsers; leer = automatisch aus `NPM_ADMIN_PORT` |
|
||||
| `BACKUP_DIR` | Ablage für Backups/Bundles (Vorgabe `./backups`) |
|
||||
| `BACKUP_DIR` | Ablage für **manuelle** Backups (Vorgabe `./backups`); geplante Jobs haben eigene Pfade |
|
||||
| `BACKUP_AUTO` | `on`/`off` – sollen die Backup-Jobs per cron laufen? |
|
||||
| `CERT_DOMAIN`, `CERT_DAYS` | Vorgaben für selbstsignierte Zertifikate |
|
||||
|
||||
### 7.1 Wer liest die `.env` – und warum gibt es sie zusätzlich zum Skript?
|
||||
@@ -670,7 +672,81 @@ CMK_DOWNLOAD_PASSWORD=<kennwort>
|
||||
Die Zugangsdaten stammen aus dem Checkmk-Kundenportal (portal.checkmk.com).
|
||||
Die `.env` sollte deshalb `chmod 600` haben – `install.sh` setzt das.
|
||||
|
||||
### 8.4 Image holen – drei Wege
|
||||
### 8.4 Zugangsdaten vorab prüfen
|
||||
|
||||
Bevor ein mehrere Gigabyte grosser Download an einer falschen Anmeldung
|
||||
scheitert, lässt sich beides in Sekunden testen:
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh image test --edition enterprise --version 2.3.0p23
|
||||
```
|
||||
|
||||
Geprüft wird ohne jeden Download und ohne dass eine Anmeldung gespeichert wird:
|
||||
|
||||
| Prüfung | Was sie beantwortet |
|
||||
|---|---|
|
||||
| Registry erreichbar | Netzwerk, Proxy, DNS |
|
||||
| Anmeldung akzeptiert | stimmen Benutzer und Kennwort? |
|
||||
| Zugriff auf das Repository | hat das Konto die nötige Berechtigung (Subskription)? |
|
||||
| Downloadportal | liegt der Image-Tarball dort und wird die Anmeldung akzeptiert? |
|
||||
|
||||
Beispiel mit korrekten Zugangsdaten aus der `.env`:
|
||||
|
||||
```
|
||||
Registry registry.checkmk.com
|
||||
[ OK ] erreichbar (HTTP 401)
|
||||
[ OK ] Anmeldung akzeptiert
|
||||
[ OK ] Zugriff auf 'enterprise/check-mk-enterprise' vorhanden
|
||||
|
||||
Downloadportal download.checkmk.com
|
||||
[ OK ] Datei erreichbar (HTTP 200)
|
||||
https://download.checkmk.com/checkmk/2.3.0p23/check-mk-enterprise-2.3.0p23.docker.tar.gz
|
||||
|
||||
[ OK ] Zugangsweg nutzbar.
|
||||
```
|
||||
|
||||
Bei falschem Kennwort:
|
||||
|
||||
```
|
||||
Registry registry.checkmk.com
|
||||
[ OK ] erreichbar (HTTP 401)
|
||||
[FEHLER] Anmeldung abgelehnt (HTTP 401)
|
||||
Benutzername/Kennwort des Checkmk-Kundenportals pruefen
|
||||
```
|
||||
|
||||
Nützliche Unterscheidungen, die der Test trifft:
|
||||
|
||||
* **Anmeldung akzeptiert, aber kein Zugriff auf das Repository** – die
|
||||
Zugangsdaten stimmen, der Subskription fehlt aber die Berechtigung für diese
|
||||
Edition.
|
||||
* **Anmeldung akzeptiert, aber HTTP 404 im Downloadportal** – Benutzer und
|
||||
Kennwort sind richtig, nur Version oder Dateiname passen nicht. Dann die
|
||||
exakte Version angeben (kein `-latest`) oder `CMK_DOWNLOAD_URL` setzen.
|
||||
* Bei den frei verfügbaren Editionen (`raw`, `pro`, `cloud` …) meldet der Test
|
||||
„öffentliches Repository – keine Anmeldung nötig" und prüft trotzdem, ob das
|
||||
Repository wirklich abrufbar ist.
|
||||
|
||||
Optionen:
|
||||
|
||||
```bash
|
||||
# Zugangsdaten einmalig angeben, ohne sie in die .env zu schreiben
|
||||
./scripts/cmk-manage.sh image test --edition enterprise --version 2.3.0p23 \
|
||||
--user <benutzer> --password <kennwort>
|
||||
|
||||
# nur einen Bezugsweg prüfen
|
||||
./scripts/cmk-manage.sh image test --only registry
|
||||
./scripts/cmk-manage.sh image test --only download
|
||||
```
|
||||
|
||||
Die Zugangsdaten werden über eine temporäre `.netrc` an `curl` übergeben und
|
||||
erscheinen daher **nicht** in der Prozessliste. Fehlt `curl`, weicht der Test
|
||||
für die Registry auf `podman login` bzw. `docker login` aus – auch dann in eine
|
||||
Wegwerfdatei, die gespeicherte Anmeldung des Systems bleibt unberührt.
|
||||
|
||||
In der ncurses-Oberfläche liegt der Test unter
|
||||
**Checkmk-Image beschaffen/auswählen → „Zugangsdaten prüfen"**.
|
||||
|
||||
### 8.5 Image holen – drei Wege
|
||||
|
||||
**a) Aus einer Registry (empfohlen)**
|
||||
|
||||
@@ -721,7 +797,7 @@ ihn als `CMK_IMAGE` in die `.env` ein. Danach:
|
||||
sudo ./scripts/cmk-manage.sh up
|
||||
```
|
||||
|
||||
### 8.5 Nachsehen, was gilt
|
||||
### 8.6 Nachsehen, was gilt
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh image status # konfiguriertes + lokale Images
|
||||
@@ -931,7 +1007,42 @@ vollqualifiziert, damit Podman sie nicht bei `registry.access.redhat.com` sucht.
|
||||
In der ncurses-Oberfläche liegt alles unter **„Terminal-Browser (Proxy Manager
|
||||
lokal bedienen)"**.
|
||||
|
||||
### 11.3 Grenze: Datei-Upload
|
||||
### 11.3 Schwarzes Fenster: die Startseite antwortet nicht
|
||||
|
||||
Bleibt nach `Starting Browsh …` / `Waiting for Firefox to connect…` alles
|
||||
schwarz, liegt es fast immer daran, dass **auf der Startseite nichts
|
||||
antwortet** – nicht am Browser. Ein Terminal-Browser zeigt in dem Fall keine
|
||||
Fehlerseite, sondern gar nichts. Dass Browsh selbst läuft, merkt man daran,
|
||||
dass `Strg+Q` noch ins Menü zurückführt.
|
||||
|
||||
Das Skript prüft die Startseite deshalb vorher und nennt die Ursache:
|
||||
|
||||
```
|
||||
[ WARN ] Auf http://127.0.0.1:81 antwortet nichts.
|
||||
Ein Terminal-Browser zeigt dann nur eine schwarze Seite.
|
||||
|
||||
Das ist die Oberflaeche des NGINX Proxy Managers.
|
||||
Er ist abgeschaltet (NPM_ENABLED=off):
|
||||
./scripts/cmk-manage.sh npm-enable on
|
||||
|
||||
Trotzdem starten? [j/N]
|
||||
```
|
||||
|
||||
Unterschieden werden:
|
||||
|
||||
| Lage | Meldung |
|
||||
|---|---|
|
||||
| Proxy Manager abgeschaltet | Hinweis auf `npm-enable on` |
|
||||
| Container fehlt oder gestoppt | Hinweis auf `up` |
|
||||
| Container läuft, antwortet aber nicht | Hinweis auf `logs` und `npm-port` |
|
||||
| Checkmk-Oberfläche (Port 5000) tot | Hinweis auf `up` bzw. `sites` |
|
||||
| externe Adresse | Hinweis auf den Netzzugang des Hosts |
|
||||
|
||||
Mit `--no-check` lässt sich die Prüfung überspringen. In der Oberfläche
|
||||
erscheint dieselbe Diagnose als Dialog mit der Wahl, trotzdem zu starten oder
|
||||
im Menü eine andere Startseite einzugeben.
|
||||
|
||||
### 11.4 Grenze: Datei-Upload
|
||||
|
||||
Ein Terminal-Browser kann keinen Dateiauswahl-Dialog des Betriebssystems
|
||||
öffnen. Für **Let's Encrypt** ist das egal (dort werden nur Formularfelder
|
||||
@@ -990,7 +1101,7 @@ sudo ./scripts/cmk-manage.sh browser --engine shell
|
||||
> E-Mail-Adresse und Kennwort. Das geht am einfachsten im Browser
|
||||
> (`cmk-manage.sh browser`); danach funktioniert die API mit den neuen Daten.
|
||||
|
||||
### 11.4 Alternative: SSH-Tunnel
|
||||
### 11.5 Alternative: SSH-Tunnel
|
||||
|
||||
Falls SSH auf die Maschine möglich ist, ist der Tunnel der bequemste Weg –
|
||||
dann bedient man die Oberfläche im gewohnten Browser:
|
||||
@@ -1094,6 +1205,75 @@ ein anderer Dienst lauscht.
|
||||
> überflüssig – dann genügt die Umgebungsvariable. Bis dahin ist der
|
||||
> Erweiterungspunkt der Weg, der ohne Änderung am Image auskommt.
|
||||
|
||||
### 12.4 Proxy Manager ganz abschalten (externer NGINX)
|
||||
|
||||
Wer die HTTPS-Terminierung schon anderweitig löst – etwa mit einem NGINX auf
|
||||
einem vorgelagerten System – braucht den Container gar nicht. Dafür gibt es
|
||||
einen Schalter:
|
||||
|
||||
```bash
|
||||
sudo ./scripts/cmk-manage.sh npm-enable off # abschalten
|
||||
sudo ./scripts/cmk-manage.sh npm-enable on # wieder einschalten
|
||||
./scripts/cmk-manage.sh npm-enable # Stand anzeigen
|
||||
```
|
||||
|
||||
In der Oberfläche steht er unter **Einstellungen → NGINX Proxy Manager →
|
||||
„Proxy Manager betreiben"**, in der `.env` heißt er `NPM_ENABLED`.
|
||||
|
||||
**Was „aus" bedeutet:** Der Container wird gestoppt und entfernt, und bei
|
||||
`up` gar nicht erst angelegt – `compose` bekommt dann nur noch den
|
||||
Checkmk-Dienst genannt. Es wird also weder ein Image geladen noch ein
|
||||
Container gebaut:
|
||||
|
||||
```
|
||||
NPM_ENABLED=off -> docker compose up -d checkmk
|
||||
NPM_ENABLED=on -> docker compose up -d checkmk nginx-proxy-manager
|
||||
```
|
||||
|
||||
**Die Daten bleiben.** Konfiguration, Datenbank und Zertifikate liegen in den
|
||||
Bind-Mounts `./data/npm/data` und `./data/npm/letsencrypt`, nicht im Container.
|
||||
Vor dem Abschalten zeigt das Kommando beides mit Größe an; beim späteren
|
||||
Einschalten wird die vorhandene Konfiguration samt Zertifikaten unverändert
|
||||
wieder aufgenommen.
|
||||
|
||||
**Was danach zu tun ist:** Der externe Proxy leitet auf Port 5000 dieses Hosts
|
||||
weiter. Der war bisher nur für localhost gedacht und muss jetzt – möglichst eng
|
||||
begrenzt – für den Proxy erreichbar sein:
|
||||
|
||||
```bash
|
||||
# firewalld
|
||||
sudo firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=<proxy-ip> port port=5000 protocol=tcp accept'
|
||||
sudo firewall-cmd --reload
|
||||
|
||||
# ufw
|
||||
sudo ufw allow from <proxy-ip> to any port 5000 proto tcp
|
||||
```
|
||||
|
||||
Im externen NGINX:
|
||||
|
||||
```nginx
|
||||
location / {
|
||||
proxy_pass http://<checkmk-host>:5000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 0;
|
||||
proxy_read_timeout 300s;
|
||||
}
|
||||
```
|
||||
|
||||
Das passende Kommando samt Beispielkonfiguration gibt `npm-enable off` direkt
|
||||
mit aus.
|
||||
|
||||
> **Der Agent-Receiver bleibt davon unberührt.** Die Agents sprechen Port 8000
|
||||
> dieses Hosts direkt an, nicht den Proxy – der muss also weiterhin für die
|
||||
> überwachten Systeme erreichbar sein.
|
||||
|
||||
> **Bei Quadlet** ([Kapitel 6, Variante B](#variante-b--podman-quadlet-ab-podman-44-ohne-compose))
|
||||
> entfernt `install.sh --quadlet` die Unit `nginx-proxy-manager.container`,
|
||||
> solange der Schalter auf `off` steht. Schaltet man ihn später ein, genügt ein
|
||||
> erneutes `sudo ./install.sh --quadlet`.
|
||||
|
||||
---
|
||||
|
||||
## 13. Firewall
|
||||
@@ -1180,12 +1360,14 @@ Eine Dateiauswahl mit Verzeichnisnavigation ist eingebaut.
|
||||
| `start-all-sites` | alle Sites starten (wird von systemd aufgerufen) |
|
||||
| `backup …` | Backup als `.tar.gz`-Bundle |
|
||||
| `list` / `verify` / `prune --keep N` | Backups verwalten |
|
||||
| `job list\|add\|set\|del\|run\|auto` | geplante Backups (eigene Zielpfade je Job) |
|
||||
| `restore …` | Backup zurückspielen |
|
||||
| `import …` | Migrations-Bundle einspielen |
|
||||
| `image status\|list\|pull\|download\|load\|use` | Checkmk-Image beschaffen und auswaehlen |
|
||||
| `browser [--engine …]` | Terminal-Browser im Container – Proxy Manager lokal bedienen |
|
||||
| `config list\|get\|set\|edit` | Einstellungen der `.env` anzeigen und ändern |
|
||||
| `npm-port [PORT]` | Port der Proxy-Manager-Oberfläche setzen/anzeigen |
|
||||
| `npm-enable [on\|off]` | Proxy Manager ein-/ausschalten (Daten bleiben erhalten) |
|
||||
| `cert …` | selbstsigniertes Zertifikat erzeugen |
|
||||
| `shell` | Root-Shell im Checkmk-Container |
|
||||
| `omd …` | beliebiges `omd`-Kommando im Container |
|
||||
@@ -1290,17 +1472,112 @@ Auflisten und prüfen:
|
||||
./scripts/cmk-manage.sh prune --keep 7
|
||||
```
|
||||
|
||||
### Nächtliches Backup per Cron
|
||||
### 15.1 Geplante Backups (Backup-Jobs)
|
||||
|
||||
Manuelle Backups gehen immer nach `BACKUP_DIR` aus der `.env`. Geplante Jobs
|
||||
bringen dagegen **ihr eigenes Zielverzeichnis** mit – so lässt sich täglich auf
|
||||
eine NAS-Freigabe und wöchentlich woanders hin sichern.
|
||||
|
||||
Im Menü: **backup → „Backup erstellen / planen"**
|
||||
|
||||
```
|
||||
┌──────────── Backup erstellen / planen ─────────────────┐
|
||||
│ Manuelle Backups gehen immer nach: │
|
||||
│ /opt/checkmk-stack/backups (Einstellung BACKUP_DIR)│
|
||||
│ │
|
||||
│ Geplante Jobs haben ihr eigenes Zielverzeichnis. │
|
||||
│ Automatische Ausfuehrung: aus │
|
||||
│ │
|
||||
│ manuell Backup jetzt erstellen │
|
||||
│ jobs Backup-Jobs verwalten │
|
||||
│ auto Automatische Ausfuehrung ein/aus │
|
||||
│ status Zeitplan und Jobs anzeigen │
|
||||
│ jetzt Einen Job sofort ausfuehren │
|
||||
│ back zurueck │
|
||||
└────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
Dieselben Jobs liegen auch in den **Einstellungen → „Backup-Jobs"**.
|
||||
|
||||
#### Job anlegen
|
||||
|
||||
Im Menü führt ein Dialog durch Sites, Zeitplan (täglich / wöchentlich /
|
||||
monatlich / freier Cron-Ausdruck), Zielverzeichnis, Aufbewahrung und Optionen.
|
||||
Dasselbe per Parameter:
|
||||
|
||||
```bash
|
||||
sudo crontab -e
|
||||
# täglich 02:15, alle Sites, ohne Logs, 14 Backups aufbewahren
|
||||
sudo ./scripts/cmk-manage.sh job add --name nachts \
|
||||
--cron "15 2 * * *" --no-logs --keep 14
|
||||
|
||||
# sonntags 03:30, nur zwei Sites, auf die NAS, ohne RRDs, 8 aufbewahren
|
||||
sudo ./scripts/cmk-manage.sh job add --name nas-woche \
|
||||
--cron "30 3 * * 0" --sites prod,test \
|
||||
--dir /mnt/nas/checkmk --no-rrds --no-logs --keep 8
|
||||
```
|
||||
|
||||
```cron
|
||||
15 2 * * * /opt/checkmk-stack/scripts/cmk-manage.sh -y backup --all --no-logs >>/var/log/cmk-backup.log 2>&1
|
||||
30 3 * * 0 /opt/checkmk-stack/scripts/cmk-manage.sh -y prune --keep 14 >>/var/log/cmk-backup.log 2>&1
|
||||
Alle Kommandos:
|
||||
|
||||
| Kommando | Wirkung |
|
||||
|---|---|
|
||||
| `job list` | angelegte Jobs anzeigen |
|
||||
| `job status` | Zeitplan, Cron-Datei und Schalter |
|
||||
| `job add --name N --cron "…"` | Job anlegen |
|
||||
| `job set NAME …` | Job ändern (nicht genannte Felder bleiben) |
|
||||
| `job del NAME` | Job löschen (die Backups bleiben) |
|
||||
| `job enable\|disable NAME` | Job ein-/ausschalten |
|
||||
| `job run NAME` | Job sofort ausführen |
|
||||
| `job run-all` | alle aktiven Jobs ausführen |
|
||||
| `job auto on\|off` | automatische Ausführung ein/aus |
|
||||
|
||||
Optionen von `job add` / `job set`:
|
||||
|
||||
| Option | Bedeutung |
|
||||
|---|---|
|
||||
| `--sites ALL\|a,b` | zu sichernde Sites (Vorgabe `ALL`) |
|
||||
| `--cron "15 2 * * *"` | Zeitplan, fünf Cron-Felder |
|
||||
| `--dir VERZ` | Zielverzeichnis dieses Jobs (Vorgabe `BACKUP_DIR`) |
|
||||
| `--keep N` | wie viele Backups im Ziel bleiben (`0` = alle) |
|
||||
| `--no-rrds`, `--no-logs`, `--stop` | wie bei `backup` |
|
||||
| `--disabled` | anlegen, aber noch nicht einplanen |
|
||||
|
||||
#### Automatik ein- und ausschalten
|
||||
|
||||
```bash
|
||||
sudo ./scripts/cmk-manage.sh job auto on # einplanen
|
||||
sudo ./scripts/cmk-manage.sh job auto off # Zeitplan entfernen
|
||||
```
|
||||
|
||||
`on` schreibt aus allen **aktiven** Jobs die Datei `/etc/cron.d/checkmk-backup`
|
||||
– je Job eine Zeile mit seinem eigenen Zeitplan:
|
||||
|
||||
```cron
|
||||
15 2 * * * root /opt/checkmk-stack/scripts/cmk-manage.sh -y job run nachts >>/var/log/cmk-backup.log 2>&1
|
||||
30 3 * * 0 root /opt/checkmk-stack/scripts/cmk-manage.sh -y job run nas-woche >>/var/log/cmk-backup.log 2>&1
|
||||
```
|
||||
|
||||
Dafür werden root-Rechte gebraucht. Ohne root gibt das Kommando die Zeilen
|
||||
aus, damit man sie selbst übernehmen kann. `off` entfernt die Datei wieder; die
|
||||
Jobs selbst bleiben erhalten. Der Schalter steht als `BACKUP_AUTO` in der
|
||||
`.env`.
|
||||
|
||||
Nach jedem Lauf räumt der Job sein eigenes Zielverzeichnis auf `--keep` auf –
|
||||
ein separater `prune`-Eintrag ist nicht nötig.
|
||||
|
||||
#### Wo die Jobs liegen
|
||||
|
||||
In `backup-jobs.conf` im Projektverzeichnis, eine Zeile je Job:
|
||||
|
||||
```
|
||||
name|sites|cron|verzeichnis|optionen|aufbewahren|aktiv
|
||||
nachts|ALL|15 2 * * *|/opt/checkmk-stack/backups|--no-logs|14|on
|
||||
nas-woche|prod,test|30 3 * * 0|/mnt/nas/checkmk|--no-rrds --no-logs|8|on
|
||||
```
|
||||
|
||||
Die Datei ist bewusst lesbar und versionierbar, gehört aber nicht ins
|
||||
Repository (sie steht in `.gitignore`, weil sie systemspezifische Pfade
|
||||
enthält).
|
||||
|
||||
---
|
||||
|
||||
## 16. Restore
|
||||
@@ -1587,12 +1864,16 @@ Checkmk-Werksnotizen (Werks/Release Notes) lesen.
|
||||
| `podman-compose` nicht gefunden | EPEL aktivieren oder auf Quadlet umstellen (`./install.sh --quadlet`) |
|
||||
| `This system is not registered with an entitlement server` | RHEL ohne Subskription – `dnf` liefert dann gar keine Pakete. Registrieren, Installations-DVD als Repository einbinden oder auf Rocky/Alma wechseln: [Abschnitt 5.1](#51-unregistriertes-rhel-woher-die-pakete-kommen) |
|
||||
| `epel-release` lässt sich nicht installieren | EPEL setzt Red Hats Basis-Repositories voraus und ersetzt die Registrierung nicht. Ohne Subskription führt der Quadlet-Weg ohne `podman-compose` zum Ziel: [Kapitel 6, Variante B](#variante-b--podman-quadlet-ab-podman-44-ohne-compose) |
|
||||
| Proxy-Manager-Container startet nicht mehr mit | Schalter steht auf `off`: `cmk-manage.sh npm-enable on`. Prüfen mit `cmk-manage.sh npm-enable` |
|
||||
| Adminoberfläche aus dem LAN nicht erreichbar | Port 81 gesperrt. Auf einen freien Port legen: `cmk-manage.sh npm-port 10443` und in der Firewall freigeben |
|
||||
| Nach `npm-port` antwortet der neue Port nicht | Proxy Manager wurde nicht neu gestartet: `cmk-manage.sh restart`; Datei prüfen: `data/npm/data/nginx/custom/http.conf` |
|
||||
| `cmk-manage.sh` bricht mit „CMK_RUNTIME … ist nicht installiert" ab | wird nur noch gewarnt und selbst gesucht; sauber setzen mit `config set CMK_RUNTIME auto` |
|
||||
| Browser bleibt schwarz, „Waiting for Firefox to connect…" | Die Startseite antwortet nicht – meist läuft der Proxy Manager nicht. Das Skript meldet das jetzt vorab, siehe [Kapitel 11.3](#113-schwarzes-fenster-die-startseite-antwortet-nicht) |
|
||||
| Proxy-Manager-Oberfläche im Browser leer / nur Textfragmente | Textbrowser ohne JavaScript verwendet. `cmk-manage.sh browser --engine browsh` (bzw. `carbonyl`) nehmen |
|
||||
| Selbstsigniertes Zertifikat lässt sich im Terminal-Browser nicht hochladen | Datei-Dialoge gibt es dort nicht – Upload über die API, siehe [Kapitel 11.3](#113-grenze-datei-upload) |
|
||||
| Selbstsigniertes Zertifikat lässt sich im Terminal-Browser nicht hochladen | Datei-Dialoge gibt es dort nicht – Upload über die API, siehe [Kapitel 11.4](#114-grenze-datei-upload) |
|
||||
| `browser` meldet „braucht ein echtes Terminal" | Aufruf aus Pipe/Skript. Direkt auf der Konsole oder per SSH aufrufen; nur der Bau geht headless mit `--build-only` |
|
||||
| Menüpunkt bricht mit einer Fehlermeldung in die Shell ab | behoben: fehlende Container, Sites oder Backups werden jetzt als Dialog gemeldet, die Oberfläche bleibt offen |
|
||||
| `job auto on` meldet fehlende Rechte | `/etc/cron.d/` braucht root: mit `sudo` aufrufen, oder die ausgegebenen Zeilen selbst übernehmen |
|
||||
| TUI startet nicht | `dialog` installieren: `apt-get install -y dialog` bzw. `dnf install -y dialog` |
|
||||
| Site startet nicht, `tmp`-Fehler | `./scripts/cmk-manage.sh omd config <site> set TMPFS off`, danach Site starten |
|
||||
|
||||
|
||||
+295
-12
@@ -131,7 +131,7 @@ agents.
|
||||
| 80/tcp | NGINX Proxy Manager – HTTP, Let's Encrypt challenge | internet/LAN |
|
||||
| 443/tcp | NGINX Proxy Manager – HTTPS | internet/LAN |
|
||||
| 81/tcp | NGINX Proxy Manager – **admin interface** (default; changeable via [`npm-port`](#12-moving-the-admin-interface-to-a-different-port)) | admin network only! |
|
||||
| 5000/tcp | Checkmk Apache (backend) | **localhost only** – do not expose |
|
||||
| 5000/tcp | Checkmk Apache (backend) | **localhost only** – do not expose. Exception: with the Proxy Manager turned off ([12.4](#124-turning-the-proxy-manager-off-entirely-external-nginx)), open it for the external proxy's IP only |
|
||||
| 8000/tcp | Checkmk agent receiver (TLS-registered agents) | monitored hosts |
|
||||
| 6557/tcp | Livestatus (only with `CMK_LIVESTATUS_TCP=on`) | distributed sites |
|
||||
|
||||
@@ -553,9 +553,11 @@ The most important settings:
|
||||
| `CMK_LIVESTATUS_TCP` | `on` opens port 6557 for distributed monitoring |
|
||||
| `MAIL_RELAY_HOST` | SMTP relay for notifications |
|
||||
| `TZ` | time zone, e.g. `Europe/Berlin` |
|
||||
| `NPM_ENABLED` | `on`/`off` – should the Proxy Manager container run at all? See [12.4](#124-turning-the-proxy-manager-off-entirely-external-nginx) |
|
||||
| `NPM_ADMIN_PORT` | port of the Proxy Manager interface (default 81) – change only via `npm-port` or the menu |
|
||||
| `NPM_ADMIN_URL` | start page of the terminal browser; empty = derived from `NPM_ADMIN_PORT` |
|
||||
| `BACKUP_DIR` | location for backups/bundles (default `./backups`) |
|
||||
| `BACKUP_DIR` | location for **manual** backups (default `./backups`); scheduled jobs have their own paths |
|
||||
| `BACKUP_AUTO` | `on`/`off` – should the backup jobs run via cron? |
|
||||
| `CERT_DOMAIN`, `CERT_DAYS` | defaults for self-signed certificates |
|
||||
|
||||
### 7.1 Who reads `.env` – and why does it exist alongside the script?
|
||||
@@ -673,7 +675,83 @@ CMK_DOWNLOAD_PASSWORD=<password>
|
||||
The credentials come from the Checkmk customer portal (portal.checkmk.com).
|
||||
`.env` should therefore be `chmod 600` – `install.sh` takes care of that.
|
||||
|
||||
### 8.4 Fetching the image – three ways
|
||||
### 8.4 Testing the credentials first
|
||||
|
||||
Rather than having a multi-gigabyte download fail on a wrong login, both can be
|
||||
checked in seconds:
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh image test --edition enterprise --version 2.3.0p23
|
||||
```
|
||||
|
||||
Nothing is downloaded and no login is stored. What gets checked:
|
||||
|
||||
| Check | What it answers |
|
||||
|---|---|
|
||||
| registry reachable | network, proxy, DNS |
|
||||
| login accepted | are the username and password correct? |
|
||||
| access to the repository | does the account have the required entitlement (subscription)? |
|
||||
| download portal | is the image tarball there and is the login accepted? |
|
||||
|
||||
Example with correct credentials from `.env`:
|
||||
|
||||
```
|
||||
Registry registry.checkmk.com
|
||||
[ OK ] erreichbar (HTTP 401)
|
||||
[ OK ] Anmeldung akzeptiert
|
||||
[ OK ] Zugriff auf 'enterprise/check-mk-enterprise' vorhanden
|
||||
|
||||
Downloadportal download.checkmk.com
|
||||
[ OK ] Datei erreichbar (HTTP 200)
|
||||
https://download.checkmk.com/checkmk/2.3.0p23/check-mk-enterprise-2.3.0p23.docker.tar.gz
|
||||
|
||||
[ OK ] Zugangsweg nutzbar.
|
||||
```
|
||||
|
||||
With a wrong password:
|
||||
|
||||
```
|
||||
Registry registry.checkmk.com
|
||||
[ OK ] erreichbar (HTTP 401)
|
||||
[FEHLER] Anmeldung abgelehnt (HTTP 401)
|
||||
Benutzername/Kennwort des Checkmk-Kundenportals pruefen
|
||||
```
|
||||
|
||||
(`erreichbar` = reachable, `Anmeldung akzeptiert` = login accepted,
|
||||
`Anmeldung abgelehnt` = login rejected, `Zugangsweg nutzbar` = a route works.)
|
||||
|
||||
Useful distinctions the test makes:
|
||||
|
||||
* **Login accepted, but no access to the repository** – the credentials are
|
||||
correct, but the subscription lacks the entitlement for this edition.
|
||||
* **Login accepted, but HTTP 404 on the download portal** – username and
|
||||
password are right, only the version or file name does not match. Give the
|
||||
exact version (no `-latest`) or set `CMK_DOWNLOAD_URL`.
|
||||
* For the freely available editions (`raw`, `pro`, `cloud`, …) the test reports
|
||||
"public repository – no login required" and still verifies that the
|
||||
repository can actually be reached.
|
||||
|
||||
Options:
|
||||
|
||||
```bash
|
||||
# supply credentials once without writing them to .env
|
||||
./scripts/cmk-manage.sh image test --edition enterprise --version 2.3.0p23 \
|
||||
--user <user> --password <password>
|
||||
|
||||
# check only one route
|
||||
./scripts/cmk-manage.sh image test --only registry
|
||||
./scripts/cmk-manage.sh image test --only download
|
||||
```
|
||||
|
||||
The credentials are passed to `curl` through a temporary `.netrc` and therefore
|
||||
do **not** appear in the process list. If `curl` is missing, the registry check
|
||||
falls back to `podman login` / `docker login` – into a throwaway file as well,
|
||||
so the system's stored login is left untouched.
|
||||
|
||||
In the ncurses interface the test lives under
|
||||
**Checkmk-Image beschaffen/auswählen → "Zugangsdaten prüfen"**.
|
||||
|
||||
### 8.5 Fetching the image – three ways
|
||||
|
||||
**a) From a registry (recommended)**
|
||||
|
||||
@@ -724,7 +802,7 @@ typically `localhost/checkmk/check-mk-enterprise:2.3.0p23`) and writes it to
|
||||
sudo ./scripts/cmk-manage.sh up
|
||||
```
|
||||
|
||||
### 8.5 Checking what is in effect
|
||||
### 8.6 Checking what is in effect
|
||||
|
||||
```bash
|
||||
./scripts/cmk-manage.sh image status # configured image + local images
|
||||
@@ -936,7 +1014,43 @@ so that Podman does not look for them at `registry.access.redhat.com`.
|
||||
In the ncurses interface everything lives under *"Terminal-Browser (Proxy
|
||||
Manager lokal bedienen)"*.
|
||||
|
||||
### 11.3 Limitation: file upload
|
||||
### 11.3 Blank screen: the start page does not answer
|
||||
|
||||
If everything stays black after `Starting Browsh …` /
|
||||
`Waiting for Firefox to connect…`, it is almost always because **nothing
|
||||
answers on the start page** – not because of the browser. A terminal browser
|
||||
shows no error page in that case, just nothing. You can tell that Browsh itself
|
||||
is running because `Ctrl+Q` still returns you to the menu.
|
||||
|
||||
The script therefore checks the start page beforehand and names the cause:
|
||||
|
||||
```
|
||||
[ WARN ] Auf http://127.0.0.1:81 antwortet nichts.
|
||||
Ein Terminal-Browser zeigt dann nur eine schwarze Seite.
|
||||
|
||||
Das ist die Oberflaeche des NGINX Proxy Managers.
|
||||
Er ist abgeschaltet (NPM_ENABLED=off):
|
||||
./scripts/cmk-manage.sh npm-enable on
|
||||
|
||||
Trotzdem starten? [j/N]
|
||||
```
|
||||
|
||||
("nothing answers on …", "a terminal browser then shows only a black page",
|
||||
"it is switched off", "start anyway?") The cases it distinguishes:
|
||||
|
||||
| Situation | Message |
|
||||
|---|---|
|
||||
| Proxy Manager switched off | points to `npm-enable on` |
|
||||
| container missing or stopped | points to `up` |
|
||||
| container runs but does not answer | points to `logs` and `npm-port` |
|
||||
| Checkmk interface (port 5000) dead | points to `up` or `sites` |
|
||||
| external address | points to the host's network access |
|
||||
|
||||
`--no-check` skips the check. In the interface the same diagnosis appears as a
|
||||
dialog offering to start anyway or to pick a different start page from the
|
||||
menu.
|
||||
|
||||
### 11.4 Limitation: file upload
|
||||
|
||||
A terminal browser cannot open the operating system's file chooser. For
|
||||
**Let's Encrypt** that does not matter (only form fields are filled in), but
|
||||
@@ -995,7 +1109,7 @@ sudo ./scripts/cmk-manage.sh browser --engine shell
|
||||
> address and password. That is easiest in the browser
|
||||
> (`cmk-manage.sh browser`); afterwards the API works with the new credentials.
|
||||
|
||||
### 11.4 Alternative: SSH tunnel
|
||||
### 11.5 Alternative: SSH tunnel
|
||||
|
||||
If SSH access to the machine is possible, a tunnel is the most convenient
|
||||
route – you then use the interface in your usual browser:
|
||||
@@ -1097,6 +1211,74 @@ listening on the port you want.
|
||||
> unnecessary – the environment variable will be enough. Until then, the
|
||||
> extension point is the route that needs no change to the image.
|
||||
|
||||
### 12.4 Turning the Proxy Manager off entirely (external NGINX)
|
||||
|
||||
If HTTPS termination is already handled elsewhere – for instance by an NGINX on
|
||||
an upstream system – the container is not needed at all. There is a switch for
|
||||
that:
|
||||
|
||||
```bash
|
||||
sudo ./scripts/cmk-manage.sh npm-enable off # turn off
|
||||
sudo ./scripts/cmk-manage.sh npm-enable on # turn back on
|
||||
./scripts/cmk-manage.sh npm-enable # show the current state
|
||||
```
|
||||
|
||||
In the interface it is under **Einstellungen → NGINX Proxy Manager →
|
||||
"Proxy Manager betreiben"**; in `.env` it is called `NPM_ENABLED`.
|
||||
|
||||
**What "off" means:** the container is stopped and removed, and is not created
|
||||
by `up` in the first place – `compose` is only told about the Checkmk service.
|
||||
So no image is pulled and no container is built:
|
||||
|
||||
```
|
||||
NPM_ENABLED=off -> docker compose up -d checkmk
|
||||
NPM_ENABLED=on -> docker compose up -d checkmk nginx-proxy-manager
|
||||
```
|
||||
|
||||
**The data stays.** Configuration, database and certificates live in the bind
|
||||
mounts `./data/npm/data` and `./data/npm/letsencrypt`, not inside the
|
||||
container. Before turning it off, the command shows both with their sizes; when
|
||||
you turn it back on, the existing configuration and certificates are picked up
|
||||
unchanged.
|
||||
|
||||
**What to do afterwards:** the external proxy forwards to port 5000 of this
|
||||
host. That port was meant for localhost only so far and now has to be reachable
|
||||
for the proxy – as narrowly as possible:
|
||||
|
||||
```bash
|
||||
# firewalld
|
||||
sudo firewall-cmd --permanent --add-rich-rule='rule family=ipv4 source address=<proxy-ip> port port=5000 protocol=tcp accept'
|
||||
sudo firewall-cmd --reload
|
||||
|
||||
# ufw
|
||||
sudo ufw allow from <proxy-ip> to any port 5000 proto tcp
|
||||
```
|
||||
|
||||
In the external NGINX:
|
||||
|
||||
```nginx
|
||||
location / {
|
||||
proxy_pass http://<checkmk-host>:5000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 0;
|
||||
proxy_read_timeout 300s;
|
||||
}
|
||||
```
|
||||
|
||||
`npm-enable off` prints the matching commands and this example configuration
|
||||
for you.
|
||||
|
||||
> **The agent receiver is unaffected.** Agents talk to port 8000 of this host
|
||||
> directly, not through the proxy – so it must stay reachable for the monitored
|
||||
> systems.
|
||||
|
||||
> **With Quadlet** ([chapter 6, option B](#option-b--podman-quadlet-podman-44-and-newer-no-compose))
|
||||
> `install.sh --quadlet` removes the `nginx-proxy-manager.container` unit while
|
||||
> the switch is `off`. If you turn it on later, simply run
|
||||
> `sudo ./install.sh --quadlet` again.
|
||||
|
||||
---
|
||||
|
||||
## 13. Firewall
|
||||
@@ -1186,12 +1368,14 @@ A file chooser with directory navigation is built in.
|
||||
| `start-all-sites` | start all sites (invoked by systemd) |
|
||||
| `backup …` | backup as a `.tar.gz` bundle |
|
||||
| `list` / `verify` / `prune --keep N` | manage backups |
|
||||
| `job list\|add\|set\|del\|run\|auto` | scheduled backups (own target path per job) |
|
||||
| `restore …` | restore a backup |
|
||||
| `import …` | import a migration bundle |
|
||||
| `image status\|list\|pull\|download\|load\|use` | obtain and select the Checkmk image |
|
||||
| `browser [--engine …]` | terminal browser in a container – operate the Proxy Manager locally |
|
||||
| `config list\|get\|set\|edit` | show and change settings in `.env` |
|
||||
| `npm-port [PORT]` | set/show the port of the Proxy Manager interface |
|
||||
| `npm-enable [on\|off]` | turn the Proxy Manager on/off (data is preserved) |
|
||||
| `cert …` | create a self-signed certificate |
|
||||
| `shell` | root shell in the Checkmk container |
|
||||
| `omd …` | any `omd` command inside the container |
|
||||
@@ -1299,17 +1483,112 @@ Listing and verifying:
|
||||
./scripts/cmk-manage.sh prune --keep 7
|
||||
```
|
||||
|
||||
### Nightly backup via cron
|
||||
### 15.1 Scheduled backups (backup jobs)
|
||||
|
||||
Manual backups always go to `BACKUP_DIR` from `.env`. Scheduled jobs, by
|
||||
contrast, bring **their own target directory** – so you can back up to a NAS
|
||||
share daily and somewhere else weekly.
|
||||
|
||||
In the menu: **backup → "Backup erstellen / planen"** (create / schedule)
|
||||
|
||||
```
|
||||
┌──────────── Backup erstellen / planen ─────────────────┐
|
||||
│ Manuelle Backups gehen immer nach: │
|
||||
│ /opt/checkmk-stack/backups (Einstellung BACKUP_DIR)│
|
||||
│ │
|
||||
│ Geplante Jobs haben ihr eigenes Zielverzeichnis. │
|
||||
│ Automatische Ausfuehrung: aus │
|
||||
│ │
|
||||
│ manuell Backup jetzt erstellen │
|
||||
│ jobs Backup-Jobs verwalten │
|
||||
│ auto Automatische Ausfuehrung ein/aus │
|
||||
│ status Zeitplan und Jobs anzeigen │
|
||||
│ jetzt Einen Job sofort ausfuehren │
|
||||
│ back zurueck │
|
||||
└────────────────────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
(create now / manage jobs / automatic execution on-off / show schedule / run a
|
||||
job now / back.) The same jobs are also reachable from
|
||||
**Einstellungen → "Backup-Jobs"**.
|
||||
|
||||
#### Creating a job
|
||||
|
||||
In the menu a dialog walks through sites, schedule (daily / weekly / monthly /
|
||||
free cron expression), target directory, retention and options. The same with
|
||||
parameters:
|
||||
|
||||
```bash
|
||||
sudo crontab -e
|
||||
# daily at 02:15, all sites, without logs, keep 14 backups
|
||||
sudo ./scripts/cmk-manage.sh job add --name nachts \
|
||||
--cron "15 2 * * *" --no-logs --keep 14
|
||||
|
||||
# Sundays at 03:30, two sites only, to the NAS, without RRDs, keep 8
|
||||
sudo ./scripts/cmk-manage.sh job add --name nas-woche \
|
||||
--cron "30 3 * * 0" --sites prod,test \
|
||||
--dir /mnt/nas/checkmk --no-rrds --no-logs --keep 8
|
||||
```
|
||||
|
||||
```cron
|
||||
15 2 * * * /opt/checkmk-stack/scripts/cmk-manage.sh -y backup --all --no-logs >>/var/log/cmk-backup.log 2>&1
|
||||
30 3 * * 0 /opt/checkmk-stack/scripts/cmk-manage.sh -y prune --keep 14 >>/var/log/cmk-backup.log 2>&1
|
||||
All commands:
|
||||
|
||||
| Command | Effect |
|
||||
|---|---|
|
||||
| `job list` | show the configured jobs |
|
||||
| `job status` | schedule, cron file and switch |
|
||||
| `job add --name N --cron "…"` | create a job |
|
||||
| `job set NAME …` | modify a job (fields not given stay as they are) |
|
||||
| `job del NAME` | delete a job (the backups remain) |
|
||||
| `job enable\|disable NAME` | turn a job on/off |
|
||||
| `job run NAME` | run a job right now |
|
||||
| `job run-all` | run every active job |
|
||||
| `job auto on\|off` | turn automatic execution on/off |
|
||||
|
||||
Options for `job add` / `job set`:
|
||||
|
||||
| Option | Meaning |
|
||||
|---|---|
|
||||
| `--sites ALL\|a,b` | sites to back up (default `ALL`) |
|
||||
| `--cron "15 2 * * *"` | schedule, five cron fields |
|
||||
| `--dir DIR` | this job's target directory (default `BACKUP_DIR`) |
|
||||
| `--keep N` | how many backups stay in the target (`0` = all) |
|
||||
| `--no-rrds`, `--no-logs`, `--stop` | as for `backup` |
|
||||
| `--disabled` | create it but do not schedule it yet |
|
||||
|
||||
#### Turning automation on and off
|
||||
|
||||
```bash
|
||||
sudo ./scripts/cmk-manage.sh job auto on # schedule
|
||||
sudo ./scripts/cmk-manage.sh job auto off # remove the schedule
|
||||
```
|
||||
|
||||
`on` writes `/etc/cron.d/checkmk-backup` from all **active** jobs – one line
|
||||
per job with its own schedule:
|
||||
|
||||
```cron
|
||||
15 2 * * * root /opt/checkmk-stack/scripts/cmk-manage.sh -y job run nachts >>/var/log/cmk-backup.log 2>&1
|
||||
30 3 * * 0 root /opt/checkmk-stack/scripts/cmk-manage.sh -y job run nas-woche >>/var/log/cmk-backup.log 2>&1
|
||||
```
|
||||
|
||||
This needs root. Without root the command prints the lines so you can add them
|
||||
yourself. `off` removes the file again; the jobs themselves are kept. The
|
||||
switch is stored as `BACKUP_AUTO` in `.env`.
|
||||
|
||||
After each run a job prunes its own target directory down to `--keep` – a
|
||||
separate `prune` entry is not needed.
|
||||
|
||||
#### Where the jobs live
|
||||
|
||||
In `backup-jobs.conf` in the project directory, one line per job:
|
||||
|
||||
```
|
||||
name|sites|cron|directory|options|keep|enabled
|
||||
nachts|ALL|15 2 * * *|/opt/checkmk-stack/backups|--no-logs|14|on
|
||||
nas-woche|prod,test|30 3 * * 0|/mnt/nas/checkmk|--no-rrds --no-logs|8|on
|
||||
```
|
||||
|
||||
The file is deliberately readable and diffable, but does not belong in the
|
||||
repository (it is in `.gitignore` because it contains system-specific paths).
|
||||
|
||||
---
|
||||
|
||||
## 16. Restore
|
||||
@@ -1596,12 +1875,16 @@ release notes beforehand.
|
||||
| `podman-compose` not found | enable EPEL or switch to Quadlet (`./install.sh --quadlet`) |
|
||||
| `This system is not registered with an entitlement server` | RHEL without a subscription – `dnf` then supplies no packages at all. Register, mount the installation DVD as a repository, or switch to Rocky/Alma: [section 5.1](#51-unregistered-rhel-where-the-packages-come-from) |
|
||||
| `epel-release` cannot be installed | EPEL depends on Red Hat's base repositories and is no substitute for registering. Without a subscription, the Quadlet route without `podman-compose` gets you there: [chapter 6, option B](#option-b--podman-quadlet-podman-44-and-newer-no-compose) |
|
||||
| Proxy Manager container no longer starts | the switch is `off`: `cmk-manage.sh npm-enable on`. Check with `cmk-manage.sh npm-enable` |
|
||||
| Admin interface unreachable from the LAN | port 81 blocked. Move it to a free port: `cmk-manage.sh npm-port 10443` and open that in the firewall |
|
||||
| New port does not answer after `npm-port` | the Proxy Manager was not restarted: `cmk-manage.sh restart`; check the file `data/npm/data/nginx/custom/http.conf` |
|
||||
| `cmk-manage.sh` aborts with "CMK_RUNTIME … ist nicht installiert" | it now only warns and detects the runtime itself; set it cleanly with `config set CMK_RUNTIME auto` |
|
||||
| Browser stays black, "Waiting for Firefox to connect…" | The start page does not answer – usually the Proxy Manager is not running. The script now reports this beforehand, see [chapter 11.3](#113-blank-screen-the-start-page-does-not-answer) |
|
||||
| Proxy Manager interface blank / only text fragments | a text browser without JavaScript was used. Use `cmk-manage.sh browser --engine browsh` (or `carbonyl`) |
|
||||
| Self-signed certificate cannot be uploaded in the terminal browser | there are no file dialogs there – upload via the API, see [chapter 11.3](#113-limitation-file-upload) |
|
||||
| Self-signed certificate cannot be uploaded in the terminal browser | there are no file dialogs there – upload via the API, see [chapter 11.4](#114-limitation-file-upload) |
|
||||
| `browser` reports "braucht ein echtes Terminal" (needs a real terminal) | called from a pipe/script. Call it on the console or over SSH; only the build runs headless, with `--build-only` |
|
||||
| A menu entry drops out to the shell with an error | fixed: missing containers, sites or backups are now reported in a dialog and the interface stays open |
|
||||
| `job auto on` reports missing permissions | `/etc/cron.d/` needs root: call it with `sudo`, or add the printed lines yourself |
|
||||
| The TUI does not start | install `dialog`: `apt-get install -y dialog` or `dnf install -y dialog` |
|
||||
| Site does not start, `tmp` errors | `./scripts/cmk-manage.sh omd config <site> set TMPFS off`, then start the site |
|
||||
|
||||
|
||||
+12
-6
@@ -242,10 +242,10 @@ fi
|
||||
# systemd
|
||||
# ---------------------------------------------------------------------
|
||||
install_compose_unit() {
|
||||
local compose_bin
|
||||
detect_compose
|
||||
compose_bin="${COMPOSE_CMD[*]}"
|
||||
|
||||
log "Verwendetes Compose-Kommando: ${COMPOSE_CMD[*]}"
|
||||
# Die Unit ruft bewusst cmk-manage.sh auf statt compose direkt: nur so
|
||||
# werden NPM_ENABLED und der Start aller Sites beruecksichtigt.
|
||||
log "Richte systemd-Unit 'checkmk-stack.service' ein ..."
|
||||
cat >/etc/systemd/system/checkmk-stack.service <<EOF
|
||||
[Unit]
|
||||
@@ -262,10 +262,10 @@ RemainAfterExit=yes
|
||||
WorkingDirectory=$PROJECT_DIR
|
||||
EnvironmentFile=$PROJECT_DIR/.env
|
||||
TimeoutStartSec=0
|
||||
ExecStart=/bin/sh -c '$compose_bin up -d'
|
||||
ExecStart=$PROJECT_DIR/scripts/cmk-manage.sh -y up
|
||||
ExecStartPost=$PROJECT_DIR/scripts/cmk-manage.sh start-all-sites
|
||||
ExecStop=/bin/sh -c '$compose_bin down'
|
||||
ExecReload=/bin/sh -c '$compose_bin up -d'
|
||||
ExecStop=$PROJECT_DIR/scripts/cmk-manage.sh -y down
|
||||
ExecReload=$PROJECT_DIR/scripts/cmk-manage.sh -y up
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -280,6 +280,12 @@ install_quadlet_units() {
|
||||
[ -d /etc/containers/systemd ] || mkdir -p /etc/containers/systemd
|
||||
local f
|
||||
for f in "$PROJECT_DIR"/systemd/quadlet/*.container; do
|
||||
# Proxy Manager abgeschaltet? Dann auch keine Unit dafuer.
|
||||
if [ "$(basename "$f")" = "nginx-proxy-manager.container" ] && ! npm_enabled; then
|
||||
log "NPM_ENABLED=off - ueberspringe nginx-proxy-manager.container"
|
||||
rm -f /etc/containers/systemd/nginx-proxy-manager.container
|
||||
continue
|
||||
fi
|
||||
sed -e "s|__PROJECT_DIR__|$PROJECT_DIR|g" \
|
||||
-e "s|__CMK_IMAGE__|${CMK_IMAGE:-docker.io/checkmk/check-mk-raw:2.3.0-latest}|g" \
|
||||
-e "s|__NPM_IMAGE__|${NPM_IMAGE:-docker.io/jc21/nginx-proxy-manager:2}|g" \
|
||||
|
||||
+1274
-75
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,8 @@ load_env() {
|
||||
NPM_CONTAINER_NAME="${NPM_CONTAINER_NAME:-nginx-proxy-manager}"
|
||||
CMK_SITE_ID="${CMK_SITE_ID:-cmk}"
|
||||
CMK_IMAGE="${CMK_IMAGE:-docker.io/checkmk/check-mk-raw:2.3.0-latest}"
|
||||
NPM_ENABLED="${NPM_ENABLED:-on}"
|
||||
BACKUP_AUTO="${BACKUP_AUTO:-off}"
|
||||
NPM_ADMIN_PORT="${NPM_ADMIN_PORT:-81}"
|
||||
# Leer = automatisch aus dem Admin-Port ableiten
|
||||
NPM_ADMIN_URL="${NPM_ADMIN_URL:-http://127.0.0.1:$NPM_ADMIN_PORT}"
|
||||
@@ -133,6 +135,14 @@ compose() {
|
||||
# ---------------------------------------------------------------------
|
||||
# Container-Helfer
|
||||
# ---------------------------------------------------------------------
|
||||
# Ist der NGINX Proxy Manager eingeschaltet? (on/true/1/yes = ja)
|
||||
npm_enabled() {
|
||||
case "$(printf '%s' "${NPM_ENABLED:-on}" | tr 'A-Z' 'a-z')" in
|
||||
on|true|1|yes|ja|y) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
container_exists() { $RUNTIME container inspect "$1" >/dev/null 2>&1; }
|
||||
container_running() { [ "$($RUNTIME container inspect -f '{{.State.Running}}' "$1" 2>/dev/null)" = "true" ]; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user