{"id":10705,"date":"2024-03-15T09:21:46","date_gmt":"2024-03-14T23:51:46","guid":{"rendered":"https:\/\/agix.com.au\/?p=10705"},"modified":"2024-03-15T09:25:32","modified_gmt":"2024-03-14T23:55:32","slug":"installing-configuring-zabbix-agent2-on-ubuntu","status":"publish","type":"post","link":"https:\/\/agix.com.au\/installing-configuring-zabbix-agent2-on-ubuntu\/","title":{"rendered":"Installing & Configuring Zabbix Agent2 on Ubuntu"},"content":{"rendered":"

This article demonstrates how to install and configure the Zabbix Agent2. Our Zabbix server is already up and running, but the host (that we’re about to add) isn’t listed in Zabbix yet.<\/p>\n

On the Zabbix server:<\/strong><\/p>\n

    \n
  1. Log into the Zabbix web portal<\/li>\n
  2. => Data collection<\/li>\n
  3. => Hosts<\/li>\n
  4. => Create host<\/li>\n<\/ol>\n

    In the host frame, complete the fields using the following as a guide. Change the example entries to fit your situation. I use [ and ] to show my comments and examples. Exclude those symbols from your values.<\/p>\n

      \n
    1. Set Hostname => [linux-server-hostname] (exactly how the client presents its self)<\/em><\/li>\n
    2. Host group => [Linux]<\/li>\n
    3. Interface => add => [192.168.0.44]<\/li>\n
    4. Template => [Linux]<\/li>\n
    5. Description => [Added by AGIX]<\/li>\n
    6. => Add.<\/li>\n<\/ol>\n

      On the host that we want to join to Zabbix:<\/strong><\/p>\n

      Run the following commands to install and start the Zabbix agent.<\/p>\n

      wget https:\/\/repo.zabbix.com\/zabbix\/6.4\/ubuntu\/pool\/main\/z\/zabbix-release\/zabbix-release_6.4-1+ubuntu20.04_all.deb\r\ndpkg -i zabbix-release_6.4-1+ubuntu20.04_all.deb\r\napt update && apt install zabbix-agent2 zabbix-agent2-plugin-*\r\nsystemctl restart zabbix-agent2\r\nsystemctl enable zabbix-agent2\r\ncp \/etc\/zabbix\/zabbix_agent2.conf \/etc\/zabbix\/zabbix_agent2.conf.orig<\/pre>\n

      Edit the “\/etc\/zabbix\/zabbix_agent2.conf” file to include only the following. Obviously you can add and remove parts. Change the IP address of your Zabbix client from “192.168.0.44” to it’s real IPv4 address.<\/p>\n

      Server=zabbix-server.example.local\r\nServerActive=zabbix-server.example.local\r\n# This hosts IP address:\r\nListenIP=192.168.0.44\r\nHostname=linux-server-hostname\r\nPidFile=\/var\/run\/zabbix\/zabbix_agent2.pid\r\nLogFile=\/var\/log\/zabbix\/zabbix_agent2.log\r\nLogFileSize=0\r\nInclude=\/etc\/zabbix\/zabbix_agent2.d\/*.conf\r\nPluginSocket=\/run\/zabbix\/agent.plugin.sock\r\nControlSocket=\/run\/zabbix\/agent.sock\r\nInclude=\/etc\/zabbix\/zabbix_agent2.d\/plugins.d\/*.conf<\/pre>\n

      Now you can restart Zabbix agent and monitor the logs for issues. If there are no issues, check the Zabbix server to see if the new host is communicating.<\/p>\n

      systemctl restart zabbix-agent2\r\ntail -f \/var\/log\/zabbix\/zabbix_agent2.log<\/pre>\n

      At this point you should be done. It can take a few minutes for the Zabbix web portal to show the new host as active.<\/p>\n","protected":false},"excerpt":{"rendered":"

      This article demonstrates how to install and configure the Zabbix Agent2. Our Zabbix server is already up and running, but the host (that we’re about to add) isn’t listed in Zabbix yet. On the Zabbix server: Log into the Zabbix web portal => Data collection => Hosts => Create host<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,115,113],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10705"}],"collection":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/comments?post=10705"}],"version-history":[{"count":5,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10705\/revisions"}],"predecessor-version":[{"id":10710,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/10705\/revisions\/10710"}],"wp:attachment":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/media?parent=10705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/categories?post=10705"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/tags?post=10705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}