Before we proceed with the agent install it is better to have the host/server you wish to monitor already added on Zabbix Server’s front end(Web GUI).
The following instruction will help you with the installation of Zabbix agent 2.2.1 on CentOS 6.4 or RHEL 6:
- On your CentOS/RHEL server add this Zabbix repository by executing the following command:
rpm -ivh <a style="color: #0088cc;" title="Zabbix Agent Install" href="http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-agent-2.2.1-1.el6.x86_64.rpm" target="_blank">http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-agent-2.2.1-1.el6.x86_64.rpm</a>
- We will now Install Zabbix agent by entering the following command:
yum install zabbix-agent
Now the installation of Zabbix Agent is completed we can proceed with the configuration of Zabbix Agent.
- Configure the zabbix configuration file found under /etc/zabbix/zabbix_agentd.conf with your favorite editor and edit the following lines:
<em>Server=<strong><IP address or FQDN of your Zabbix server></strong></em> <em>ServerActive=<strong><IP-address or FQDN of the Zabbix server for active checks> </strong></em>(this is usually the same server) <em>Hostname=<strong><the hostname of this server or just type system.hostname> </strong>(should match the hostname as you’ve added in Zabbix FrontEnd)</em>
- Let’s now configure the Zabbix agent to start automatically during OS boot by executing the following command
chkconfig zabbix-agent on
- Now that we have completed all Zabbix configuration we can start the agent using the following command:
service zabbix-agent start
or with:
/etc/init.d/zabbix-agent start
If you have IPtables running on your Linux server then it needs to allow the following Zabbix ports:
TCP 10050 and 10051
So we add the following rules to allow communication between the Zabbix server and the Zabbix agent:
iptables -I INPUT 1 -p tcp -s <em><strong><zabbix server IP-address></strong></em> -–dport 10050 -j ACCEPT iptables -I OUTPUT 1 -p tcp -s <em><strong><zabbix server IP-address></strong></em> -–dport 10051 -j ACCEPT
We now need to save the above 2 rules in IPtables by running the following command:
/sbin/service iptables save
If you have a chain name specified then you will need to mention that during the save.
I would personally restart the IPtables for the changes to take affect and flush any pending changes.
service iptables restart
If you now visit your Zabbix server’s web page for the agent part of the newly added host/server you should see a Green check next to it.
We will cover more on Zabbix monitoring for Linux in depth at later series. If you have any recommendation or advise on how to get Zabbix installed quicker and more efficiently then please share it with the community