Skip to content

Building Zabbix agent

linuxonz edited this page Nov 21, 2024 · 46 revisions

Building Zabbix agent

Below versions of Zabbix agent are available in respective distributions at the time of creation of these build instructions:

  • RHEL (8.8, 8.10, 9.2, 9.4) have 7.0.4
  • SLES 15 SP5 has 4.0.50
  • SLES 15 SP6 has 6.0.28
  • Ubuntu 20.04 has 4.0.17
  • Ubuntu 22.04 has 5.0.17

The instructions provided below specify the steps to build Zabbix agent version 7.0.5 on Linux on IBM Z for following distributions:

  • RHEL (8.8, 8.10, 9.2, 9.4)
  • SLES (15 SP5, 15 SP6)
  • Ubuntu (20.04, 22.04, 24.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

1. Build using script

If you want to build Zabbix agent using manual steps, go to STEP 2.

Use the following commands to build Zabbix agent using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Zabbix/7.0.5/build_zabbixagent.sh

# Build zabbix agent
bash build_zabbixagent.sh

If the build completes successfully, Zabbix agent is started. In case of error, check Note at the end of this recipe or logs for more details or go to STEP 2 to follow manual build steps.

2. Install dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (8.8, 8.10, 9.2, 9.4)

    sudo yum install -y tar wget make gcc pcre-devel
    
  • SLES (15 SP5, 15 SP6)

    sudo zypper install -y tar wget make gcc awk pcre-devel
    
  • Ubuntu (20.04, 22.04, 24.04)

    sudo apt-get update
    sudo apt-get -y install tar wget make gcc libpcre3-dev
    

3. Download and install Zabbix agent

  • Download Zabbix agent

    cd $SOURCE_ROOT
    wget https://cdn.zabbix.com/zabbix/sources/stable/7.0/zabbix-7.0.5.tar.gz
    tar -xzf zabbix-7.0.5.tar.gz
    
  • Install Zabbix agent

    cd $SOURCE_ROOT/zabbix-7.0.5
    export CFLAGS="-std=gnu99"
    ./configure --enable-agent
    make
    sudo make install
    

4. Post installation steps

  • Create a zabbix user required to start Zabbix agent daemon

     sudo groupadd zabbix
     sudo useradd -g zabbix zabbix
    
  • Edit Zabbix agent configuration file /usr/local/etc/zabbix_agentd.conf

  • Add Zabbix server IP address beside Server= and enter the hostnames as configured on the server beside Hostname=

  • Start Zabbix agent

    export PATH=$PATH:/usr/local/sbin/:/usr/local/bin/
    zabbix_agentd
    

Note: If you get an error " cannot open "/tmp/zabbix_agentd.log" ", change file permissions of Zabbix agent log file using the command sudo chmod 766 /tmp/zabbix_agentd.log and start Zabbix agent again.

  • Verify the installed Zabbix agent version with the following command:

    zabbix_get -s <host_ip> -k "agent.version"
    

References:

Clone this wiki locally