{"id":1783,"date":"2021-11-10T06:06:09","date_gmt":"2021-11-10T06:06:09","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=1783"},"modified":"2021-11-10T06:06:09","modified_gmt":"2021-11-10T06:06:09","slug":"zabbix-agent","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2021\/11\/10\/zabbix-agent\/","title":{"rendered":"Zabbix Agent"},"content":{"rendered":"\n<p>In this blog I will walk you through basic steps needed to deploy a Zabbix 5 Agent on a <code>Centos<\/code> Machine. The Zabbix Release is available <a rel=\"noreferrer noopener\" href=\"https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/7\/x86_64\/\" data-type=\"URL\" data-id=\"https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/7\/x86_64\/\" target=\"_blank\">here<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Machine<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>root@node4>cat \/etc\/redhat-release \nCentOS Linux release 7.9.2009 (Core)<\/code><\/pre>\n\n\n\n<p>Download and install the RPM<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -Uvh https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/7\/x86_64\/zabbix-release-5.4-1.el7.noarch.rpm <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>root@node4>rpm -Uvh https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/7\/x86_64\/zabbix-release-5.4-1.el7.noarch.rpm \nRetrieving https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/7\/x86_64\/zabbix-release-5.4-1.el7.noarch.rpm\nwarning: \/var\/tmp\/rpm-tmp.eYow7B: Header V4 RSA\/SHA512 Signature, key ID a14fe591: NOKEY\nPreparing...                          ################################# &#91;100%]\nUpdating \/ installing...\n   1:zabbix-release-5.4-1.el7         ################################# &#91;100%]\nroot@node4>yum install zabbix-agent\nLoaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager\n\nThis system is not registered with an entitlement server. You can use subscription-manager to register.\n\nLoading mirror speeds from cached hostfile\n * base: centos.excellmedia.net\n * extras: centos.excellmedia.net\n * updates: centos.mirror.snu.edu.in\nbase                                                                                                                                                                                                          | 3.6 kB  00:00:00     \ndocker-ce-stable                                                                                                                                                                                              | 3.5 kB  00:00:00     \nextras                                                                                                                                                                                                        | 2.9 kB  00:00:00     \nkubernetes\/signature                                                                                                                                                                                          |  844 B  00:00:00     \nkubernetes\/signature                                                                                                                                                                                          | 1.4 kB  00:00:00 !!! \nupdates                                                                                                                                                                                                       | 2.9 kB  00:00:00     \nzabbix                                                                                                                                                                                                        | 2.9 kB  00:00:00     \nzabbix-non-supported                                                                                                                                                                                          | 2.9 kB  00:00:00     \n(1\/3): updates\/7\/x86_64\/primary_db                                                                                                                                                                            |  12 MB  00:00:01     \n(2\/3): zabbix-non-supported\/x86_64\/primary_db                                                                                                                                                                 | 3.7 kB  00:00:01     \n(3\/3): zabbix\/x86_64\/primary_db                                                                                                                                                                               |  47 kB  00:00:01     \nResolving Dependencies\n--> Running transaction check\n---> Package zabbix-agent.x86_64 0:5.4.7-1.el7 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n=====================================================================================================================================================================================================================================\n Package                                                   Arch                                                Version                                                     Repository                                           Size\n=====================================================================================================================================================================================================================================\nInstalling:\n zabbix-agent                                              x86_64                                              5.4.7-1.el7                                                 zabbix                                              479 k\n\nTransaction Summary\n=====================================================================================================================================================================================================================================\nInstall  1 Package\n\nTotal download size: 479 k\nInstalled size: 2.0 M\nIs this ok &#91;y\/d\/N]: y\nDownloading packages:\nwarning: \/var\/cache\/yum\/x86_64\/7\/zabbix\/packages\/zabbix-agent-5.4.7-1.el7.x86_64.rpm: Header V4 RSA\/SHA512 Signature, key ID a14fe591: NOKEY=                                                      ]  93 kB\/s | 192 kB  00:00:03 ETA \nPublic key for zabbix-agent-5.4.7-1.el7.x86_64.rpm is not installed\nzabbix-agent-5.4.7-1.el7.x86_64.rpm                                                                                                                                                                           | 479 kB  00:00:02     \nRetrieving key from file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-ZABBIX-A14FE591\nImporting GPG key 0xA14FE591:\n Userid     : \"Zabbix LLC &lt;packager@zabbix.com>\"\n Fingerprint: a184 8f53 52d0 22b9 471d 83d0 082a b56b a14f e591\n Package    : zabbix-release-5.4-1.el7.noarch (installed)\n From       : \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-ZABBIX-A14FE591\nIs this ok &#91;y\/N]: y\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\nWarning: RPMDB altered outside of yum.\nInstalling : zabbix-agent-5.4.7-1.el7.x86_64                                                                                                                                                                                   1\/1 \n  Verifying  : zabbix-agent-5.4.7-1.el7.x86_64                                                                                                                                                                                   1\/1 \n\nInstalled:\n  zabbix-agent.x86_64 0:5.4.7-1.el7                                                                                                                                                                                                  \n\nComplete!<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/etc\/zabbix\/zabbix_agentd.conf<\/code><\/pre>\n\n\n\n<p>Update he following sections with the correct values for your Zabbix Server. In my case the server is <code>zabbix.server.com<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ServerActive=zabbix.server.com<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Server=zabbix.server.com<\/code><\/pre>\n\n\n\n<p>Save and exit the configuration edit mode.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Firewall entries<\/h2>\n\n\n\n<p>The port that it listens on is <code>10050<\/code> so add it to the rules<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>firewall-cmd --zone=public --add-port=10050\/tcp --permanent<\/code><\/pre>\n\n\n\n<p>reload the firewall<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>Start the agent as under and you should see output similar to what is shown below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>> systemctl status zabbix-agent.service\n> systemctl start zabbix-agent.service\n\n\u25cf zabbix-agent.service - Zabbix Agent\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/zabbix-agent.service; enabled; vendor preset: disabled)\n   Active: active (running) since Tue 2021-11-09 09:01:54 UTC; 5s ago\n  Process: 148585 ExecStart=\/usr\/sbin\/zabbix_agentd -c $CONFFILE (code=exited, status=0\/SUCCESS)\n Main PID: 148597 (zabbix_agentd)\n    Tasks: 6\n   Memory: 2.5M\n   CGroup: \/system.slice\/zabbix-agent.service\n           \u251c\u2500148597 \/usr\/sbin\/zabbix_agentd -c \/etc\/zabbix\/zabbix_agentd.conf\n           \u251c\u2500148598 \/usr\/sbin\/zabbix_agentd: collector &#91;idle 1 sec]\n           \u251c\u2500148599 \/usr\/sbin\/zabbix_agentd: listener #1 &#91;waiting for connection]\n           \u251c\u2500148600 \/usr\/sbin\/zabbix_agentd: listener #2 &#91;waiting for connection]\n           \u251c\u2500148601 \/usr\/sbin\/zabbix_agentd: listener #3 &#91;waiting for connection]\n           \u2514\u2500148602 \/usr\/sbin\/zabbix_agentd: active checks #1 &#91;idle 1 sec]<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>tailf -10 \/var\/log\/zabbix\/zabbix_agentd.log <\/code><\/pre>\n\n\n\n<p>Your agent has been configured, now you need to go to the Zabbix Server and navigate to <code>Configuration -> Hosts<\/code><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"176\" height=\"290\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.30.32-AM-1.png\" alt=\"\" class=\"wp-image-1785\"\/><figcaption>Menu Hosts<\/figcaption><\/figure><\/div>\n\n\n\n<p>Navigate to create <code>Host<\/code><\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"354\" height=\"238\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.31.25-AM.png\" alt=\"\" class=\"wp-image-1786\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.31.25-AM.png 354w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.31.25-AM-300x202.png 300w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><figcaption>Create host<\/figcaption><\/figure><\/div>\n\n\n\n<p>Fill in the values for IP, host and display name and select the template<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"422\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-1024x422.png\" alt=\"\" class=\"wp-image-1787\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-1024x422.png 1024w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-300x124.png 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-768x316.png 768w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-1536x633.png 1536w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-2048x844.png 2048w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.32.24-AM-300x124@2x.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>Host<\/figcaption><\/figure><\/div>\n\n\n\n<p>The values for my machine are filled in like below<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-1024x466.png\" alt=\"\" class=\"wp-image-1788\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-1024x466.png 1024w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-300x137.png 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-768x349.png 768w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-1536x699.png 1536w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-2048x932.png 2048w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.33.31-AM-300x137@2x.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>When you are done it will show up as below<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"103\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-1024x103.png\" alt=\"\" class=\"wp-image-1789\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-1024x103.png 1024w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-300x30.png 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-768x77.png 768w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-1536x155.png 1536w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-2048x207.png 2048w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-10-at-11.34.37-AM-300x30@2x.png 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this blog I will walk you through basic steps needed to deploy a Zabbix 5 Agent on a Centos Machine. The Zabbix Release is available here. Machine Download and install the RPM Update he following sections with the correct values for your Zabbix Server. In my case the server is zabbix.server.com Save and exit [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1785,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[34],"tags":[201,112,200],"class_list":["post-1783","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-technical","tag-infra","tag-linux","tag-zabbix","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=1783"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1783\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/1785"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=1783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=1783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=1783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}