See what version of CentOS we’re using:

1
cat /etc/redhat-release

Add the repository and install the package

1
2
3
sudo yum -y install http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.6-1.el7.x86_64.rpm

sudo yum -y install zabbix-agent

After sucessfull installation we’ve to change the following settings.

1
sudo vi /etc/zabbix/zabbix_agentd.conf

Set the following to your needs:

1
2
3
4
5
6
7
8
# specify Zabbix server
Server=zabbix.domain.local

# specify Zabbix server
ServerActive=zabbix.domain.local

# change to the own hostname
Hostname=hostname.domain.local

Now you can enable the zabbix-agent as service and starting the agent.

1
2
3
4
5
6
7
sudo yum -y install policycoreutils-python

grep "denied.*zabbix_agent" /var/log/audit/audit.log | audit2allow -M zabbix_agent
sudo semodule -i zabbix_agent.pp

grep "denied.*zabbix_server" /var/log/audit/audit.log | audit2allow -M zabbix_server
sudo semodule -i zabbix_server.pp
1
2
3
sudo systemctl enable zabbix-agent
# Or "restart" if already started
sudo systemctl start zabbix-agent

Of course, we’ve to open the necessary firewall ports, by default this are 10050/10051.

1
2
3
sudo firewall-cmd --add-service={http,https} --permanent
sudo firewall-cmd --add-port={10051/tcp,10050/tcp} --permanent
sudo firewall-cmd --reload

You’re done!