|
|
|
@@ -977,3 +977,87 @@ When moving an existing service, migrate its data and provisioning state and
|
|
|
|
|
let outstanding jobs finish before switching destinations.
|
|
|
|
|
For mail on a separate server, retrieve logins on the mail node, and use the
|
|
|
|
|
[separate-node backup workflow](development.md#bundle-backups-from-separate-nodes).
|
|
|
|
|
|
|
|
|
|
## Monitor local and remote services
|
|
|
|
|
|
|
|
|
|
The panel's **Service health** page shows the latest observation and timestamp
|
|
|
|
|
for each configured service and node. Superusers and operators with **Can
|
|
|
|
|
view service health** can open the page. The collector checks systemd unit
|
|
|
|
|
states. Use the corresponding service tests to check mail delivery, DNS
|
|
|
|
|
answers, or website responses. The collector and dashboard both need the
|
|
|
|
|
panel database to record and display observations.
|
|
|
|
|
|
|
|
|
|
Set `COULOBRE_SERVICE_HEALTH` in `/etc/coulobre/panel.env`. This example checks
|
|
|
|
|
local panel services and two records for remote mail and DNS services.
|
|
|
|
|
|
|
|
|
|
```ini
|
|
|
|
|
COULOBRE_SERVICE_HEALTH='{"panel-01":{"local":["panel","worker","scheduler","apache","php-fpm","mariadb","rabbitmq"]},"mail-01":{"ssh":["postfix","dovecot"]},"dns-01":{"ssh":["bind9"]}}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Choose an ID for each node using lower-case letters, numbers, and hyphens,
|
|
|
|
|
starting with a letter. Keep the IDs stable for the same hosts. List one
|
|
|
|
|
`local` node per panel installation and use `ssh` for each additional host.
|
|
|
|
|
Use `bind9`, `postfix`, and `dovecot` under `local` for co-located services.
|
|
|
|
|
Remote checks accept those same three service names. The SSH client matches
|
|
|
|
|
each remote node ID to a `Host` entry.
|
|
|
|
|
|
|
|
|
|
Install the collector with a dedicated service identity after updating the
|
|
|
|
|
panel package.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo useradd --system --user-group --no-create-home --home-dir /nonexistent \
|
|
|
|
|
--shell /usr/sbin/nologin coulobre-health
|
|
|
|
|
sudo install -m 0644 deploy/systemd/coulobre-health.service \
|
|
|
|
|
deploy/systemd/coulobre-health.timer /etc/systemd/system/
|
|
|
|
|
panel_manage migrate --noinput
|
|
|
|
|
panel_manage collectstatic --noinput
|
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
|
sudo systemctl restart coulobre-panel
|
|
|
|
|
sudo systemctl enable --now coulobre-health.timer
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The timer runs again one minute after each collection finishes. **Unknown**
|
|
|
|
|
means there is no reading or the collector could not obtain a unit state.
|
|
|
|
|
**Stale** shows the last observation when it is at least five minutes old.
|
|
|
|
|
To run a check immediately, use `sudo systemctl start coulobre-health.service`.
|
|
|
|
|
[systemctl unit properties](https://www.freedesktop.org/software/systemd/man/latest/systemctl.html)
|
|
|
|
|
|
|
|
|
|
### Enable read-only remote checks
|
|
|
|
|
|
|
|
|
|
Set up a collector key on the panel host. Configure an SSH alias for each
|
|
|
|
|
remote node and pin that server's verified SSH host public key in the
|
|
|
|
|
collector's `known_hosts` file. Use `[hostname]:port` for a nonstandard port.
|
|
|
|
|
Keep the configuration and host keys owned by root and readable by the
|
|
|
|
|
`coulobre-health` group.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo apt install openssh-client
|
|
|
|
|
sudo install -d -o root -g coulobre-health -m 0750 /etc/coulobre-health
|
|
|
|
|
sudo install -o root -g coulobre-health -m 0640 \
|
|
|
|
|
deploy/openssh/health-client.conf.example /etc/coulobre-health/ssh_config
|
|
|
|
|
sudo ssh-keygen -t ed25519 -N '' -f /etc/coulobre-health/id_ed25519
|
|
|
|
|
sudo chown coulobre-health:coulobre-health /etc/coulobre-health/id_ed25519
|
|
|
|
|
sudo cat /etc/coulobre-health/id_ed25519.pub
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
On each remote host, install the same Coulobre package in `/opt/coulobre`.
|
|
|
|
|
Save the collector public key as `panel-health.pub`. Use the key only for
|
|
|
|
|
the receiver below. The SSH account runs the fixed status command under its
|
|
|
|
|
own unprivileged identity.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo apt install openssh-server
|
|
|
|
|
sudo useradd --system --user-group --no-create-home --home-dir / --shell /bin/sh \
|
|
|
|
|
coulobre-health-request
|
|
|
|
|
sudo install -d -m 0755 /etc/ssh/coulobre-node-keys
|
|
|
|
|
sudo install -o root -g root -m 0644 panel-health.pub \
|
|
|
|
|
/etc/ssh/coulobre-node-keys/coulobre-health-request
|
|
|
|
|
sudo install -m 0644 deploy/openssh/coulobre-health-request.conf.example \
|
|
|
|
|
/etc/ssh/sshd_config.d/00-coulobre-health-request.conf
|
|
|
|
|
sudo sshd -t
|
|
|
|
|
sudo systemctl reload-or-restart ssh.service
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Restart the panel after adding node IDs. Run the collector and open **Service
|
|
|
|
|
health** to check the remote readings. Recovery of the SSH connection or the
|
|
|
|
|
service is reflected by the next successful check.
|