--docker flag: enable agent2 docker plugin (socket access via docker group)

This commit is contained in:
sam
2026-10-10 20:03:22 +00:00
parent 0d95a6bd03
commit 3d8cd7ba19
2 changed files with 46 additions and 1 deletions
+10
View File
@@ -15,6 +15,7 @@ works behind NAT/firewalls and needs no inbound ports.
# clone once, then git pull for updates:
git clone https://gitea.noctools.nz/noctools/zabbix-agent.git
sudo ./install-zabbix-agent2-ubuntu.sh --server <server-ip-or-name>
sudo ./install-zabbix-agent2-ubuntu.sh --server <server-ip-or-name> --docker # + docker monitoring
```
Or with no local copy at all:
@@ -30,9 +31,18 @@ curl -fsSL https://gitea.noctools.nz/noctools/zabbix-agent/raw/branch/main/insta
|---|---|---|
| `--server HOST[:PORT]` | Zabbix server/proxy for active checks (**required**) | — |
| `--hostname NAME` | Zabbix host name — must equal the technical name on the server | short system hostname |
| `--docker` | enable the agent2 docker plugin: grants the `zabbix` user access to `/var/run/docker.sock` via the `docker` group (Docker must already be installed) | off |
| `--major X.Y` | Zabbix repo series | `7.4` |
After installing, create the host on the Zabbix server with the **exact same
technical name** and an active-agent template (e.g. "Linux by Zabbix agent
active"). The script reports whether the agent reached the server and warns
if the host doesn't exist yet — the warning clears by itself once it does.
## Docker monitoring
`--docker` has the agent talk to `/var/run/docker.sock` (adds the `zabbix`
user to the `docker` group). On the Zabbix server, link the host to a Docker
template that uses **active** checks — e.g. "Docker by Zabbix agent 2 active"
(where present) — since agents installed by this script are reached via
active checks only.