{"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<p>In this tutorial, you will learn how to easily install Zabbix agent on Ubuntu 22.04\/Debian 11.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install Zabbix Agent on Ubuntu 22.04\/Debian 11<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.zabbix.com\/zabbix_agent\" target=\"_blank\" rel=\"noreferrer noopener\">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<figure class=\"wp-block-table\"><table><tbody><tr><th>Network<\/th><td>Packets\/bytes transferred<br>Errors\/dropped packets<br>Collisions<\/td><\/tr><tr><th>CPU<\/th><td>Load average<br>CPU idle\/usage<br>CPU utilization data per individual process<\/td><\/tr><tr><th>Memory<\/th><td>Free\/used memory<br>Swap\/pagefile utilization<\/td><\/tr><tr><th>Disk<\/th><td>Space free\/used<br>Read and write I\/O<\/td><\/tr><tr><th>Service<\/th><td>Process status<br>Process memory usage<br>Service status (ssh, ntp, ldap, smtp, ftp, http, pop, nntp, imap)<br>Windows service status<br>DNS resolution<br>TCP connectivity<br>TCP response time<\/td><\/tr><tr><th>File<\/th><td>File size\/time<br>File exists<br>Checksum<br>MD5 hash<br>RegExp search<\/td><\/tr><tr><th>Log<\/th><td>Text log<br>Windows eventlog<\/td><\/tr><tr><th>Other<\/th><td>System uptime<br>System time<br>Users connected<br>Performance counter (Windows)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Zabbix Agent capabilities<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Install Zabbix agent on Ubuntu 22.04<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Zabbix DEB Repositories on Ubuntu 22.04;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>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<pre class=\"wp-block-code\"><code>dpkg -i zabbix-release_6.0-2+ubuntu22.04_all.deb<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run system package cache update and install Zabbix agent on Ubuntu 22.04<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install zabbix-agent<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install Zabbix agent on Debian 11<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Zabbix DEB Repositories on Debian 11;<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>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<pre class=\"wp-block-code\"><code>dpkg -i zabbix-release_6.0-1+debian11_all.deb<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Zabbix Agent<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>apt update<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install zabbix-agent<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Configure Zabbix Agent<\/h3>\n\n\n\n<p>Once the installation is done, configure Zabbix agent to be able to communicate with the Zabbix server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/zabbix\/zabbix_agentd.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>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<pre class=\"wp-block-code\"><code>...\n<strong>Server=192.168.60.22<\/strong>             <strong>## IP for Zabbix Server<\/strong>\n...\n<strong>ServerActive=192.168.60.22<\/strong>       \n...\n<strong>Hostname=jellyfish<\/strong><\/code><\/pre>\n\n\n\n<p>Save and exit the file.<\/p>\n\n\n\n<p>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. <strong>Exact<\/strong> Hostname will be required while adding hosts to the Zabbix server for monitoring.<\/p>\n\n\n\n<p>If no DNS in place, use host file;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ping jellyfish -c 4<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>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<h3 class=\"wp-block-heading\">Running Zabbix Service on Ubuntu 22.04\/Debian 11<\/h3>\n\n\n\n<p>Start and enable Zabbix service on Ubuntu 22.04\/Debian 11 to run on boot;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable --now zabbix-agent<\/code><\/pre>\n\n\n\n<p>Check the status;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status zabbix-agent<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\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<p>Zabbix Agent listens on port 10050\/TCP.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ss -altnp | grep 10050<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>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<p>The server should be able to connect to the agent via this port. Hence, open this port on firewall;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ufw allow from &lt;zabbix-server-IP&gt; to any port 10050 proto tcp comment \"Allow Zabbix Server\"<\/code><\/pre>\n\n\n\n<p><strong>Also, ensure that you can connect to Zabbix server on port 10051\/tcp.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Monitor the Host from Zabbix Server<\/h3>\n\n\n\n<p>You can now add the host to the Zabbix server and start monitoring.<\/p>\n\n\n\n<p>See the link below on how to add and monitor Linux hosts using Zabbix server.<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/add-hosts-to-zabbix-server-for-monitoring\/\" target=\"_blank\" rel=\"noreferrer noopener\">Add Hosts to Zabbix Server for Monitoring<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Tutorials<\/h3>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-sensu-agent-on-windows-systems\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Sensu Agent on Windows systems<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-nagios-nrpe-agents-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install Nagios NRPE Agents on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-and-enroll-elastic-agents-to-fleet-manager-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install and Enroll Elastic Agents to Fleet Manager in Linux<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to easily install Zabbix agent on Ubuntu 22.04\/Debian 11. Install Zabbix Agent on Ubuntu 22.04\/Debian 11 Zabbix agent<\/p>\n","protected":false},"author":1,"featured_media":12698,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[72,121],"tags":[5168,5164,5163,5167,5165,5166],"class_list":["post-12746","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-howtos","tag-debian-11-zabbix-agent","tag-install-zabbix-agent-on-debian-11","tag-install-zabbix-agent-on-ubuntu-22-04","tag-ubuntu-22-04-zabbix-agent","tag-zabbix-agent-debian","tag-zabbix-agent-ubuntu","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12746"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=12746"}],"version-history":[{"count":10,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12746\/revisions"}],"predecessor-version":[{"id":20513,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/12746\/revisions\/20513"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12698"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=12746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=12746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=12746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}