{"id":12746,"date":"2022-05-15T11:14:03","date_gmt":"2022-05-15T08:14:03","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12746"},"modified":"2024-03-09T13:03:23","modified_gmt":"2024-03-09T10:03:23","slug":"install-zabbix-agent-on-ubuntu-debian","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-zabbix-agent-on-ubuntu-debian\/","title":{"rendered":"Install Zabbix Agent on Ubuntu 22.04\/Debian 11"},"content":{"rendered":"\n
In this tutorial, you will learn how to easily install Zabbix agent on Ubuntu 22.04\/Debian 11.<\/p>\n\n\n\n
Zabbix<\/a> agent can be used to poll various system metrics as outlined below and push them to Zabbix server for visualization.<\/p>\n\n\n\n Once the installation is done, configure Zabbix agent to be able to communicate with the Zabbix server.<\/p>\n\n\n\n Save and exit the file.<\/p>\n\n\n\n Ensure the agent hostname is resolvable to an IP address that it will use to communicate with the Zabbix server and not a loopback address. Exact<\/strong> Hostname will be required while adding hosts to the Zabbix server for monitoring.<\/p>\n\n\n\n If no DNS in place, use host file;<\/p>\n\n\n\n Start and enable Zabbix service on Ubuntu 22.04\/Debian 11 to run on boot;<\/p>\n\n\n\n Check the status;<\/p>\n\n\n\n Zabbix Agent listens on port 10050\/TCP.<\/p>\n\n\n\n The server should be able to connect to the agent via this port. Hence, open this port on firewall;<\/p>\n\n\n\n Also, ensure that you can connect to Zabbix server on port 10051\/tcp.<\/strong><\/p>\n\n\n\n You can now add the host to the Zabbix server and start monitoring.<\/p>\n\n\n\n See the link below on how to add and monitor Linux hosts using Zabbix server.<\/p>\n\n\n\n Add Hosts to Zabbix Server for Monitoring<\/a><\/p>\n\n\n\n Install Sensu Agent on Windows systems<\/a><\/p>\n\n\n\n Install Nagios NRPE Agents on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\nNetwork<\/th> Packets\/bytes transferred
Errors\/dropped packets
Collisions<\/td><\/tr>CPU<\/th> Load average
CPU idle\/usage
CPU utilization data per individual process<\/td><\/tr>Memory<\/th> Free\/used memory
Swap\/pagefile utilization<\/td><\/tr>Disk<\/th> Space free\/used
Read and write I\/O<\/td><\/tr>Service<\/th> Process status
Process memory usage
Service status (ssh, ntp, ldap, smtp, ftp, http, pop, nntp, imap)
Windows service status
DNS resolution
TCP connectivity
TCP response time<\/td><\/tr>File<\/th> File size\/time
File exists
Checksum
MD5 hash
RegExp search<\/td><\/tr>Log<\/th> Text log
Windows eventlog<\/td><\/tr>Other<\/th> System uptime
System time
Users connected
Performance counter (Windows)<\/td><\/tr><\/tbody><\/table>Install Zabbix agent on Ubuntu 22.04<\/h3>\n\n\n\n
\n
wget https:\/\/repo.zabbix.com\/zabbix\/6.0\/ubuntu\/pool\/main\/z\/zabbix-release\/zabbix-release_6.0-2+ubuntu22.04_all.deb<\/code><\/pre>\n\n\n\n
dpkg -i zabbix-release_6.0-2+ubuntu22.04_all.deb<\/code><\/pre>\n\n\n\n
\n
apt update<\/code><\/pre>\n\n\n\n
apt install zabbix-agent<\/code><\/pre>\n\n\n\n
Install Zabbix agent on Debian 11<\/h3>\n\n\n\n
\n
wget https:\/\/repo.zabbix.com\/zabbix\/6.0\/debian\/pool\/main\/z\/zabbix-release\/zabbix-release_6.0-1+debian11_all.deb<\/code><\/pre>\n\n\n\n
dpkg -i zabbix-release_6.0-1+debian11_all.deb<\/code><\/pre>\n\n\n\n
\n
apt update<\/code><\/pre>\n\n\n\n
apt install zabbix-agent<\/code><\/pre>\n\n\n\n
Configure Zabbix Agent<\/h3>\n\n\n\n
vim \/etc\/zabbix\/zabbix_agentd.conf<\/code><\/pre>\n\n\n\n
The only change we make here is to set Zabbix server IP address for passive and active checks, and just hostname.<\/code><\/pre>\n\n\n\n
...\nServer=192.168.60.22<\/strong> ## IP for Zabbix Server<\/strong>\n...\nServerActive=192.168.60.22<\/strong> \n...\nHostname=jellyfish<\/strong><\/code><\/pre>\n\n\n\n
ping jellyfish -c 4<\/code><\/pre>\n\n\n\n
PING jellyfish (192.168.60.23) 56(84) bytes of data.\n64 bytes from jellyfish (192.168.60.23): icmp_seq=1 ttl=64 time=0.030 ms\n64 bytes from jellyfish (192.168.60.23): icmp_seq=2 ttl=64 time=0.092 ms\n64 bytes from jellyfish (192.168.60.23): icmp_seq=3 ttl=64 time=0.035 ms\n64 bytes from jellyfish (192.168.60.23): icmp_seq=4 ttl=64 time=0.071 ms\n\n--- jellyfish ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3028ms\nrtt min\/avg\/max\/mdev = 0.030\/0.057\/0.092\/0.025 ms\n<\/code><\/pre>\n\n\n\n
Running Zabbix Service on Ubuntu 22.04\/Debian 11<\/h3>\n\n\n\n
systemctl enable --now zabbix-agent<\/code><\/pre>\n\n\n\n
systemctl status zabbix-agent<\/code><\/pre>\n\n\n\n
\u25cf zabbix-agent.service - Zabbix Agent\n Loaded: loaded (\/lib\/systemd\/system\/zabbix-agent.service; enabled; vendor preset: enabled)\n Active: active (running) since Sat 2022-05-14 22:26:15 EAT; 7min ago\n Main PID: 6340 (zabbix_agentd)\n Tasks: 6 (limit: 1693)\n Memory: 5.7M\n CPU: 190ms\n CGroup: \/system.slice\/zabbix-agent.service\n \u251c\u25006340 \/usr\/sbin\/zabbix_agentd -c \/etc\/zabbix\/zabbix_agentd.conf\n \u251c\u25006341 \/usr\/sbin\/zabbix_agentd: collector [idle 1 sec]\n \u251c\u25006342 \/usr\/sbin\/zabbix_agentd: listener #1 [waiting for connection]\n \u251c\u25006343 \/usr\/sbin\/zabbix_agentd: listener #2 [waiting for connection]\n \u251c\u25006344 \/usr\/sbin\/zabbix_agentd: listener #3 [waiting for connection]\n \u2514\u25006345 \/usr\/sbin\/zabbix_agentd: active checks #1 [idle 1 sec]\n\nMay 14 22:26:13 debian11 systemd[1]: Starting Zabbix Agent...\nMay 14 22:26:15 debian11 systemd[1]: Started Zabbix Agent.\n<\/code><\/pre>\n\n\n\n
ss -altnp | grep 10050<\/code><\/pre>\n\n\n\n
LISTEN 0 4096 0.0.0.0:10050 0.0.0.0:* users:((\"zabbix_agentd\",pid=2412,fd=4),(\"zabbix_agentd\",pid=2411,fd=4),(\"zabbix_agentd\",pid=2410,fd=4),(\"zabbix_agentd\",pid=2409,fd=4),(\"zabbix_agentd\",pid=2408,fd=4),(\"zabbix_agentd\",pid=2407,fd=4))\nLISTEN 0 4096 [::]:10050 [::]:* users:((\"zabbix_agentd\",pid=2412,fd=5),(\"zabbix_agentd\",pid=2411,fd=5),(\"zabbix_agentd\",pid=2410,fd=5),(\"zabbix_agentd\",pid=2409,fd=5),(\"zabbix_agentd\",pid=2408,fd=5),(\"zabbix_agentd\",pid=2407,fd=5))\n<\/code><\/pre>\n\n\n\n
ufw allow from <zabbix-server-IP> to any port 10050 proto tcp comment \"Allow Zabbix Server\"<\/code><\/pre>\n\n\n\n
Monitor the Host from Zabbix Server<\/h3>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n