Linux, Windows, Virtualization, OpenSource & Blogging

How to Install Zabbix Agent on CentOS 7 / Ubuntu 16.04 / Debian 8

0
Install Zabbix Agent on CentOS 7
Install Zabbix Agent on CentOS 7

In our previous article, we talked about Installing Zabbix Server on CentOS 7 / Ubuntu 16.04 / Debian 8. To monitor any remote machine, Zabbix client package “zabbix-agent” needs to be present on the machine.

The work of Zabbix Agent is to collect the data from the client machine such as resource statistics, application data, etc. and send them to Zabbix Server.

Add Zabbix Agent repository:

zabbix-agent is not available in the base repository, so to obtain zabbix-agent package you need to install zabbix repository configuration package on the client system.

### CentOS 7 ###

rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

### Ubuntu 16.04 ###

wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb
apt-get update

### Debian 8 ###

wget http://repo.zabbix.com/zabbix/3.2/debian/pool/main/z/zabbix-release/zabbix-release_3.2-1+jessie_all.deb
dpkg -i zabbix-release_3.2-1+jessie_all.deb
apt-get update

Install Zabbix Agent:

Once you have configured Zabbix repository on your machine, install the Zabbix Agent using the following command.

### CentOS 7 ###

yum install -y zabbix-agent

### Ubuntu 16.04 / Debian 8 ###

apt-get install -y zabbix-agent

Configure Zabbix Agent:

Edit the Zabbix agent file to specify the Zabbix Server details.

vi /etc/zabbix/zabbix_agentd.conf

Update the following details on the Zabbix agent file.

### Zabbix Server IP Address or Hostname ###

Server=ubuntu.itzgeek.local

### Client Hostname ###

Hostname=centos.itzgeek.local

Control Zabbix Agent:

Run the following command to start/restart the zabbix agent.

service zabbix-agent restart

Enable zabbix-agent to start automatically on system boot.

### CentOS 7 ###

systemctl enable zabbix-agent

### Ubuntu 16.04 / Debian 8 ###

update-rc.d zabbix-agent enable

SELinux:

If the zabbix-agent fails for any reason, it could be due to SELinux which is preventing it from running.

Job for zabbix-agent.service failed because a configured resource limit was exceeded. See "systemctl status zabbix-agent.service" and "journalctl -xe" for details.

Run the following command

yum install -y policycoreutils-python
cat /var/log/audit/audit.log | grep zabbix_agentd | grep denied | audit2allow -M zabbix_agent_setrlimit
semodule -i zabbix_agent_setrlimit.pp

Credit: Zabbix Support.

What Next:

READ: How to add a node to Zabbix Server for monitoring

That’s All, for now.

POSTS YOU MAY LIKE -:)

You might also like

How to Install Zabbix Agent on CentOS 7 / Ubuntu 16.04 / Debian 8

0