One-shot Ubuntu agent2 installer (active checks)
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# zabbix-agent
|
||||
|
||||
One-shot [Zabbix agent2](https://www.zabbix.com/) installer for Ubuntu,
|
||||
using **active checks** — the agent connects *out* to the server, so it
|
||||
works behind NAT/firewalls and needs no inbound ports.
|
||||
|
||||
- Idempotent — safe to re-run
|
||||
- Installs from the official Zabbix apt repo (agent2)
|
||||
- Config: `ServerActive=<server>`, `Server=127.0.0.1,<server>`,
|
||||
`Hostname=<name>` (defaults to the short system hostname)
|
||||
|
||||
## Use
|
||||
|
||||
```bash
|
||||
# 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>
|
||||
```
|
||||
|
||||
Or with no local copy at all:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://gitea.noctools.nz/noctools/zabbix-agent/raw/branch/main/install-zabbix-agent2-ubuntu.sh \
|
||||
| sudo bash -s -- --server <server-ip-or-name>
|
||||
```
|
||||
|
||||
## Flags
|
||||
|
||||
| flag | meaning | default |
|
||||
|---|---|---|
|
||||
| `--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 |
|
||||
| `--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.
|
||||
Reference in New Issue
Block a user