1. Update System Packages and Install zabbix agent
sudo apt update
sudo apt install zabbix-agent
2. Configure the Zabbix Agent: After the installation is complete, you need to configure the Zabbix agent. The configuration file is located at /etc/zabbix/zabbix_agentd.conf. Open this file in a text editor with root privileges:
sudo nano /etc/zabbix/zabbix_agentd.conf3. Set the Server and Hostname: In the configuration file, locate the Server and Hostname parameters. Uncomment these lines (remove the # symbol at the beginning) and set the IP address or hostname of the Zabbix server:
Server=<zabbix_server_ip>
Hostname=<hostname_of_agent>4. Enable the Zabbix Agent Service And Restart: By default, the Zabbix agent service is disabled. Use the following command to enable and start the service:
sudo systemctl enable --now zabbix-agent
sudo systemctl restart zabbix-agent5. Update firewall settings: The Ubuntu firewall is disabled by default. However, you still need to update your iptables configuration to allow HTTP traffic. Update iptables with the following commands.
sudo iptables -I INPUT 6 -m state --state NEW -p tcp --dport 10050 -j ACCEPT
sudo netfilter-persistent save6. test to connect the port
telnet ip 10050Other usefull commands:
sudo systemctl status zabbix-agent
sudo iptables -L
sudo ufw status
sudo ufw allow 10050
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --list-all
sudo firewall-cmd --zone=public --list-all
systemctl list-units --type=service --state=running
systemctl list-units --type=service --all
systemctl list-units --type=service --all --full
systemctl status SERVICE_NAME
ps aux
netstat -tuln | grep PORT_NUMBERReference: