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.
- Login to WHM and navigate to:
Plugins → ConfigServer Security & Firewall - Allow Zabbix Ports:
- Find the section “Firewall Configuration” and add the following ports to
TCP_INandTCP_OUT:10050,10051
- Find the section “Firewall Configuration” and add the following ports to
- 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
- Log in to Zabbix Web Interface (
http://192.168.1.11/zabbix) - Go to:
Configuration → Hosts - Click:
Create host - Enter Details:
- Hostname:
whm_server - Visible Name:
WHM Server - Groups: Click
Select, then chooseLinux Servers - Agent Interfaces:
- IP Address:
192.168.1.104 - Port:
10050
- IP Address:
- Hostname:
- Assign Template:
- Go to “Templates” Tab.
- Click
Selectand search for “Linux by Zabbix agent”. - Select it.
- Click “Add” to save the host.
Step 6: Verify Monitoring
- Go to:
Monitoring → Latest data - 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). 🎯
