Passo 01 Acessar servidor linux com a senha padrão DETIC
Passo 02 Configurar repositório do Zabbix
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-2.el6.noarch.rpm
dnf install https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm -y
yum install zabbix-agent -y
vim /etc/zabbix/zabbix_agentd.conf
Procurar e editar as seguintes linhas
Server=zabbixdc.detic.ro.gov.br
Hostname=nome_do_servidor
Reiniciar serviço do Agent
service zabbix-agent restart
ou
systemctl restart zabbix-agent
chkconfig zabbix-agent on
ou
systemctl enable zabbix-agent
Execute
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10050/udp
firewall-cmd --reload
ou
iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
iptables -I INPUT -p udp --dport 10050 -j ACCEPT
Adicionar também no arquivo.
vim /etc/sysconfig/iptables
Recarregar configurações.
service iptables reload
Caso o SELinux estiver como “Enforcing”, ele fará o bloqueio do serviço do zabbix-agent. Para alterar sem reiniciar a máquina, use os comandos.
Passo 01 Verificar estado do SELinux.
getenforce
Passo 02 Alterar estado do SELinux.
setenforce Permissive
Passo 03 Alterar também no arquivo para Permissive.
vim /etc/sysconfig/selinux
setenforce Permissive
sed -i s/'SELINUX=enforcing'/'SELINUX=permissive'/ /etc/selinux/config 2>/dev/null
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10050/udp
firewall-cmd --reload
#rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/$(rpm -E %{rhel})/x86_64/zabbix-release-5.0-1.el$(rpm -E %{rhel}).noarch.rpm
yum install zabbix-agent -y
sed -i s/'Server=127.0.0.1'/'Server=zabbixdc.setic.ro.gov.br'/ /etc/zabbix/zabbix_agentd.conf
name=$(hostname)
sed -i s/'Hostname=Zabbix server'/Hostname=$name/ /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent
systemctl enable zabbix-agent
setenforce Permissive
sed -i s/'SELINUX=enforcing'/'SELINUX=permissive'/ /etc/selinux/config 2>/dev/null
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10050/udp
firewall-cmd --reload
#rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/$(rpm -E %{rhel})/x86_64/zabbix-release-5.0-1.el$(rpm -E %{rhel}).noarch.rpm
yum install zabbix-agent -y
sed -i s/'Server=127.0.0.1'/'Server=zabbixdc.setic.ro.gov.br'/ /etc/zabbix/zabbix_agentd.conf
name=$(hostname)
sed -i s/'Hostname=Zabbix server'/Hostname=$name/ /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent
systemctl enable zabbix-agent
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
dpkg -i zabbix-release_5.0-1+$(lsb_release -sc)_all.deb
apt update -y
apt -y install zabbix-agent
sed -i s/'Server=127.0.0.1'/'Server=zabbixdc.setic.ro.gov.br'/ /etc/zabbix/zabbix_agentd.conf
name=$(hostname)
sed -i s/'Hostname=Zabbix server'/Hostname=$name/ /etc/zabbix/zabbix_agentd.conf
systemctl restart zabbix-agent
systemctl enable zabbix-agent