Packetwatch.net

Zabbix Agent in Red Hat Enterprise Linux



Last modified: Nov. 21, 2012

Contents
1 - Summary
2 - Zabbix Agent installation
3 - Service configuration
4 - Service check


1 - Summary

This guide will show how to install the Zabbix Agent in Red Hat Enterprise
Linux. The Zabbix Agent is the client software that installs on the servers and
sends information to the Zabbix server. Zabbix is an open source monitoring
solution. This has been tested in Red Hat Enterprise Linux 5 and 6 on x86 and on
x86_64.


2 - Zabbix Agent installation

Download the zabbix agent Linux 2.6.x package at http://www.zabbix.com/. Also,
download the zabbix source code. The source code is needed to get the init.d
script.
# cd ~
# mkdir zabbix
# cd zabbix/
# wget http://www.zabbix.com/downloads/$rel/zabbix_agents_$rel.linux2_6.$arch.tar.gz
# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/$rel/
zabbix-$rel.tar.gz/download
# tar -zxvf zabbix_agents_$rel.linux2_6.$arch.tar.gz
# tar -zxvf zabbix-$rel.tar.gz
# sudo chown root:root bin/zabbix_*
Password:
# sudo chown root:root sbin/zabbix_agent*
[sudo] password for user:
# sudo cp bin/zabbix_* /usr/local/bin/
[sudo] password for user:
# sudo cp sbin/zabbix_agent* /usr/local/sbin/
[sudo] password for user:
# sudo cp zabbix-$rel/misc/init.d/fedora/core5/zabbix_agentd /etc/rc.d/init.d/
[sudo] password for user:
# cd ~
# rm -fr zabbix/
# sudo chmod 755 /etc/rc.d/init.d/zabbix_agentd
[sudo] password for user:
# sudo /sbin/chkconfig --add zabbix_agentd
[sudo] password for user:

Create a group and user named zabbix.
# sudo /usr/sbin/groupadd zabbix
[sudo] password for user:
# sudo /usr/sbin/useradd -c 'Zabbix' -d / -g zabbix -M -s /sbin/nologin zabbix
[sudo] password for user:


3 - Service configuration

Enable the zabbix agent service so that it will start when the system starts up.
# sudo /sbin/chkconfig zabbix_agentd on
[sudo] password for user:
# sudo /sbin/chkconfig --list zabbix_agentd
[sudo] password for user:
zabbix_agentd   0:off   1:off   2:on    3:on    4:on    5:on    6:off

Find where the configuration file should be put.
# grep .conf /etc/rc.d/init.d/zabbix_agentd 
# chkconfig: - 95 5
# strings /usr/local/sbin/zabbix_agentd | grep zabbix_agentd.conf
/usr/local/etc/zabbix_agentd.conf

You can create your own configuration file. Here is a simple example.
  Hostname=server.test.com
  ListenPort=10050
  Server=zabbix.test.com
# sudo vi /usr/local/etc/zabbix_agentd.conf
[sudo] password for user:

Before starting the service, make sure that tcp port 10050 is open in case you
are running firewall software. Here is a sample rule.
  -A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
# sudo /sbin/service iptables stop
[sudo] password for user:
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: filter [  OK  ]
iptables: Unloading modules: [  OK  ]
# sudo cp /etc/sysconfig/iptables /etc/sysconfig/iptables.previous
[sudo] password for user:
# sudo vi /etc/sysconfig/iptables
[sudo] password for user:
# sudo /sbin/service iptables start
[sudo] password for user:
iptables: Applying firewall rules: [  OK  ]

Start the zabbix agent service.
# sudo /sbin/service zabbix_agentd start
[sudo] password for user:
Starting Zabbix Agent: [  OK  ]
# sudo sbin/service zabbix_agentd status
[sudo] password for user:
zabbix_agentd (pid 2913 2912 2911 2910 2909) is running...


4 - Service check

Reboot your computer. Log in like normal and check to see that the zabbix
agent service is running. That's it, now you have the zabbix agent running in
Red Hat Enterprise Linux.
# sudo /sbin/shutdown -r now
[sudo] password for user:
# sudo /sbin/service zabbix_agentd status
[sudo] password for user:
zabbix_agentd (pid 2619 2618 2617 2616 2615) is running...


Last modified: Thu Jan 1 00:00:00 1970 UTC
Packetwatch Research 2002-2017.