Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How to Install Zabbix Agent on CentOS/RHEL 8

    How to Install Zabbix Agent on CentOS/RHEL 8

    RahulBy RahulFebruary 3, 20203 Mins ReadUpdated:February 26, 2021

    Zabbix Agent is a process that runs on remote machines, which need to monitor through the Zabbix server. The agent collects the data on the remote server and send back to Zabbix server when requested. Zabbix agent must be installed on all the remote systems that need to be monitor through the Zabbix server.

    Basically, there are two types of checks:

    • Passive Check – Zabbix Agent sent data to server on their request.
    • Active Check – Zabbix Agent sends data periodically to server.

    After installing zabbix server on your system. Now we are moving to install agent on remote system’s. This article will help you to install zabbix agent on CentOS/RHEL 8 Linux systems. After completing this step go to next article add Host in Zabbix Server.

    Step 1 – Disable SELinux

    By default, SELinux is enabled in CentOS 8. You can disable the SELinux to work Zabbix properly on your CentOS machine.

    You can disable the SELinux by editing /etc/selinux/config file:

    nano /etc/selinux/config
    

    Change the following line:

    SELINUX=disabled
    

    Press CTRL + O to save changes and then CTRL + X to close file. Then restart your server to apply changes.

    Step 2 – Installing Zabbix Agent

    The Zabbix agent packages are not available under the default CentOS 8 repositories. So first, you will need to configure the Zabbix repository in your system.

    At the time of writing this tutorial, the latest version of Zabbix is Zabbix 4.4. You can install the Zabbix 4.4 repository package by running the following command:

    dnf install https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm
    

    After installing yum repository packages in our system. Use the following command to install the Zabbix agent on your CentOS 8 or RHEL 8 systems using the package management tool.

    dnf install zabbix-agent
    

    Press ‘Y’ for any confirmation to complete the installation process.

    Step 3 – Configure Zabbix Agent

    Now, you need to configure the Agent service to allow Zabbix server requests. Edit the Zabbix agent configuration file by adding the Zabbix server IP.

    /etc/zabbix/zabbix_agentd.conf

    #Server=[zabbix server ip]
    #Hostname=[ Hostname of client system ]
    
    Server=192.168.1.100
    Hostname=Server1
    

    Step 4 – Adjust Firewall for Zabbix

    Next, you will need to allow the Zabbix ports 10050 and 10051. and HTTP service through the firewall. You can allow them with the following command:

    firewall-cmd --permanent --add-port=10050/tcp
    firewall-cmd --reload
    

    Step 5 – Start Zabbix Agent

    Your zabbix agent service is ready to run. Execute the following commands to enable service to auto start on system boot. Then also start service for the first time:

    systemctl enable zabbix-agent
    systemctl start zabbix-agent
    

    To stop zabbix-agent service anytime run the following command:

    systemctl stop zabbix-agent
    

    Congratulation’s! You have successfully installed Zabbix Agent. Lets add host in zabbix server to be monitory.

    Agent zabbix Zabbix Agent
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Install Zabbix Server on CentOS/RHEL 8
    Next Article How to Install Ruby on CentOS/RHEL 8 and Scientific Linux

    Related Posts

    How to Install Sublime Text 4 on Ubuntu 22.04

    2 Mins Read

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    How To Install Oracle VirtualBox on Debian 11

    2 Mins Read

    8 Comments

    1. Dave on March 1, 2021 6:03 am

      With RHEL8, there is an issue with PCP. The error “cannot initialize module zbxpcp.so” is generated. The solution that worked for me was the command I found in “https://www.zabbix.com/forum/zabbix-help/380685-agent-dont-start-after-instalation-zbxpcp-so”, yum remove pcp-export-zabbix-agent.

      Reply
    2. Randy on February 26, 2021 3:07 am

      This part seems to be an issue:
      dnf install zabbix zabbix-agent

      Specifically
      dnf install zabbix-agent < this works
      dnf install zabbix < does not work

      Reply
    3. root on November 27, 2020 11:18 pm

      Rahul,

      I’d really encourage you to add in SELinux support vs disabling as Pablo pointed out. I’d also suggest folks use the most current agent and enable encryption with a cert

      Reply
    4. Pablo on November 3, 2020 11:50 am

      Ok, 2 things to add to this tutorial:
      1. DO NOT DISABLE SElinux- it is there for a reason – the reason being security as name suggests.
      Instead, execute these commands to allow zabbix-agent to communicate with server:
      setsebool -P httpd_can_connect_zabbix on
      setsebool -P httpd_can_network_connect_db on

      these with explanation can be found on OFFICIAL zabbix site – https://www.zabbix.com/documentation/4.4/manual/installation/install_from_packages/rhel_centos

      2. If You want to use acitve checks, You also need to change in /etc/zabbix/zabbix_agentd.conf line:
      ServerActive=[zabbix server ip]

      Reply
    5. Rafa on October 8, 2020 11:18 am

      that guide does not work anymore

      Reply
      • Rahul on October 9, 2020 4:57 am

        Hi Rafa, What issue are you facing with this tutorial.

        Reply
        • Saqib Jawaid on November 12, 2020 11:11 am

          am getting the following:

          Error: Transaction test error:
          file /etc/zabbix/zabbix_agentd.conf conflicts between attempted installs of zabbix40-4.0.17-1.el8.x86_64 and zabbix-agent-4.4.10-1.el8.x86_64

          Reply
    6. Attilio Signorini on June 21, 2020 10:01 am

      step 1 is just wrong, it’s like permissions are wrong, let’s put 777

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.