Add README with usage instructions
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
4657222fc1
commit
a25a793bdc
1 changed files with 61 additions and 0 deletions
61
README.md
Normal file
61
README.md
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
# install-zabbixagent
|
||||
|
||||
Script para instalação e configuração automática do **Zabbix Agent 2** em servidores Ubuntu e Debian.
|
||||
|
||||
## Compatibilidade
|
||||
|
||||
- Ubuntu 20.04
|
||||
- Ubuntu 22.04
|
||||
- Ubuntu 24.04
|
||||
- Debian 12
|
||||
- Debian 13
|
||||
|
||||
## Configuração padrão
|
||||
|
||||
| Item | Valor |
|
||||
|---|---|
|
||||
| Zabbix Server | `10.15.0.120` |
|
||||
| Versão do Zabbix | `7.4` |
|
||||
| Porta do Agent (passive) | `10050` |
|
||||
| Porta do Server (active checks) | `10051` |
|
||||
|
||||
## Uso
|
||||
|
||||
Execute como **root** na máquina que receberá o agent:
|
||||
|
||||
```bash
|
||||
wget -O install-zabbix.sh https://git.ledcloud.com.br/LED_Cloud/install-zabbixagent/raw/branch/main/install-zabbix.sh
|
||||
chmod +x install-zabbix.sh
|
||||
sudo ./install-zabbix.sh
|
||||
```
|
||||
|
||||
Ou, se o repositório já estiver clonado localmente:
|
||||
|
||||
```bash
|
||||
git clone https://git.ledcloud.com.br/LED_Cloud/install-zabbixagent.git
|
||||
cd install-zabbixagent
|
||||
chmod +x install-zabbix.sh
|
||||
sudo ./install-zabbix.sh
|
||||
```
|
||||
|
||||
## O que o script faz
|
||||
|
||||
1. Valida se o sistema operacional é suportado.
|
||||
2. Instala dependências (`wget`, `curl`, `ca-certificates`, `gnupg`).
|
||||
3. Adiciona o repositório oficial do Zabbix e instala o pacote `zabbix-agent2`.
|
||||
4. Configura `/etc/zabbix/zabbix_agent2.conf`:
|
||||
- `Server` = IP do Zabbix Server
|
||||
- `ServerActive` = IP do Zabbix Server + porta 10051
|
||||
- `Hostname` = hostname (FQDN) da máquina
|
||||
- `ListenPort` = 10050
|
||||
- `ListenIP` = 0.0.0.0
|
||||
- `Timeout` = 10
|
||||
- Um backup do arquivo original é criado antes de qualquer alteração, no formato `zabbix_agent2.conf.backup.<data>`.
|
||||
5. Habilita e reinicia o serviço `zabbix-agent2`.
|
||||
6. Valida a instalação: versão instalada, status do serviço e se a porta 10050 está escutando.
|
||||
|
||||
## Observações
|
||||
|
||||
- O script precisa ser executado como root (`sudo`).
|
||||
- Se o hostname da máquina não corresponder a um host já cadastrado no Zabbix Server, o agent ficará ativo mas não enviará dados até que o host seja criado no servidor com o mesmo `Hostname` configurado.
|
||||
- Em caso de falha ao iniciar o serviço, o script exibe automaticamente os últimos 50 logs (`journalctl -u zabbix-agent2`).
|
||||
Loading…
Add table
Reference in a new issue