Adicionados agents

This commit is contained in:
William Grando 2025-06-10 15:32:45 -03:00
parent 0469e17357
commit 9d48e3d5ba
2 changed files with 32 additions and 0 deletions

3
data/agent/arm64/install Normal file
View File

@ -0,0 +1,3 @@
wget https://repo.zabbix.com/zabbix/7.2/release/raspbian/pool/main/z/zabbix-release/zabbix-release_latest_7.2+debian11_all.deb
dpkg -i zabbix-release_latest_7.2+debian11_all.deb
apt update && apt install zabbix-agent

29
data/agent/arm64/setup.sh Normal file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# === Configurações que você deve ajustar ===
SERVER_IP="192.168.0.100"
SERVER_ACTIVE_IP="192.168.0.100"
HOSTNAME_AGENTE="$(hostname)"
LISTEN_PORT="10050" # padrão, mude se necessário
# === Caminho do arquivo de configuração ===
CONF="/etc/zabbix/zabbix_agentd.conf"
# === Validação ===
if [ ! -f "$CONF" ]; then
echo "Arquivo $CONF não encontrado. Certifique-se de que o zabbix-agent está instalado."
exit 1
fi
# === Faz backup antes de editar ===
cp "$CONF" "$CONF.bak.$(date +%Y%m%d%H%M%S)"
# === Alterações com sed ===
sed -i \
-e "s|^Server=.*|Server=$SERVER_IP|" \
-e "s|^ServerActive=.*|ServerActive=$SERVER_ACTIVE_IP|" \
-e "s|^Hostname=.*|Hostname=$HOSTNAME_AGENTE|" \
-e "s|^# ListenPort=.*|ListenPort=$LISTEN_PORT|" \
"$CONF"
echo "Arquivo $CONF atualizado com sucesso."