Article sections

    Objective:

    Monitor a WHM/cPanel server running CentOS 7.9 (IP: 192.168.1.104) using a Zabbix server (IP: 192.168.1.11).


    Step 1: Open Firewall Ports in ConfigServer Firewall (CSF)

    Since WHM uses CSF, you must allow Zabbix communication ports.

    1. Login to WHM and navigate to:Plugins → ConfigServer Security & Firewall
    2. Allow Zabbix Ports:
      • Find the section “Firewall Configuration” and add the following ports to TCP_IN and TCP_OUT:10050,10051
    3. Restart CSF
      • Scroll down and click “Restart CSF + LFD” to apply changes.

    Step 2: Install Zabbix Agent on WHM Server (192.168.1.104)

    1. Add Zabbix Repository

    Run the following commands:

    rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-4.el7.noarch.rpm
    yum clean all
    yum install -y zabbix-agent

    2. Configure Zabbix Agent

    Edit the Zabbix agent configuration file:

    nano /etc/zabbix/zabbix_agentd.conf

    Modify the following lines:

    Server=192.168.1.11,127.0.0.1
    ServerActive=192.168.1.11
    Hostname=whm_server

    Save and exit (CTRL+X, then Y and ENTER).


    Step 3: Enable and Start Zabbix Agent

    systemctl enable zabbix-agent
    systemctl start zabbix-agent

    Check if it is running:

    systemctl status zabbix-agent

    Step 4: Allow Zabbix Agent in Firewalld (If CSF is Disabled)

    If CSF is disabled and using firewalld, allow Zabbix ports:

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

    Step 5: Add Host in Zabbix Server

    1. Log in to Zabbix Web Interface (http://192.168.1.11/zabbix)
    2. Go to: Configuration → Hosts
    3. Click: Create host
    4. Enter Details:
      • Hostname: whm_server
      • Visible Name: WHM Server
      • Groups: Click Select, then choose Linux Servers
      • Agent Interfaces:
        • IP Address: 192.168.1.104
        • Port: 10050
    5. Assign Template:
      • Go to “Templates” Tab.
      • Click Select and search for “Linux by Zabbix agent”.
      • Select it.
    6. Click “Add” to save the host.

    Step 6: Verify Monitoring

    1. Go to: Monitoring → Latest data
    2. Select your WHM server and check if metrics are updating.

    Step 7: Troubleshooting

    If the host is not connecting:

    • Restart Zabbix agent:systemctl restart zabbix-agent
    • Check Zabbix agent logs:tail -f /var/log/zabbix/zabbix_agentd.log
    • Restart CSF:csf -r
    • Test connection from Zabbix Server:telnet 192.168.1.104 10050

    Conclusion

    The WHM Server (192.168.1.104) is now successfully monitored by the Zabbix Server (192.168.1.11). 🎯

    in Zabbix