Installing and configuring Zabbix agent on CentOS/RHEL

Before installation, let’s see the version of the system:

lsb_release -a

I have CentOS version 6.8 X64, remotely at that moment there was a Zabbix server version 3.0.7, so I picked up version 3.0 at http://repo.zabbix.com/zabbix/ (there is a newer one, for example 3.1, 3.2, etc. d.).
Add the source:

rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0-1.el6.noarch.rpm

For CentOS/RHEL 7 another link:

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

For CentOS/RHEL 5:

rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/zabbix-release-3.0-1.el5.noarch.rpm

Now execute the command to install the Zabbix agent:

yum install zabbix zabbix-agent

After installation, edit the configuration file, for example, with the nano editor (in which Ctrl+X for exiting, y/n and Enter for saving or canceling the changes):

nano /etc/zabbix/zabbix_agentd.conf

Namely, we indicate:
Server = 192.168.1.11 (ip address of the remote Zabbix server)
ServerActive = 192.168.1.11 (ip address of the remote Zabbix server)
Hostname = name for active checks, the same as specified in the Zabbix server for this host, you can see the system command hostname

After editing, apply the changes by restarting the Zabbix agent:

/etc/init.d/zabbix-agent restart

You can stop/start it with the commands:

/etc/init.d/zabbix-agent stop
/etc/init.d/zabbix-agent start

For autostart in Centos7/RHEL7, do:

systemctl enable zabbix-agent.service

In Centos6/RHEL6:

chkconfig zabbix-agent on

See also my article:
Install and configure Zabbix agent in Ubuntu

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading