Install zabbix agent Linux OEL5

alias ll=’ls -ltra’

Example : Install zabbix agent on vdtb4.

Create zabbix user

cat /etc/passwd

adduser zabbix

pwd : zabbixadm

addgroup zabbix admin

su – zabbix

cd /home/zabbix

Download agent and server components, unpack:

Distrib Zabbix : www.zabbix.com/download2.php

wget http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/1.8/zabbix-1.8.tar.gz
tar zxvpf zabbix-1.8.tar.gz
wget http://www.zabbix.com/downloads/1.8.5/zabbix_agents_1.8.5.linux2_6.i386.tar.gz
tar zxvf zabbix_agents_1.8.5.linux2_6.i386.tar.gz

Copy agent files and create needed directories:

cd /home/zabbix/zabbix-1.8/
mkdir /etc/zabbix
mkdir /var/log/zabbix
chown -R zabbix.zabbix /etc/zabbix/
chown -R zabbix.zabbix /var/log/zabbix
cp /home/zabbix/zabbix-1.8.5/misc/conf/zabbix_agent* /etc/zabbix/
cp /home/zabbix/bin/zabbix_get /usr/bin/
cp /home/zabbix/bin/zabbix_sender /usr/bin/
cp /home/zabbix/sbin/zabbix_agent /usr/sbin/
cp /home/zabbix/sbin/zabbix_agentd /usr/sbin/

Edit zabbix agent configuration:

vim /etc/zabbix/zabbix_agentd.conf

Change :
DebugLevel=1

Server=vmoni.ft.grp

Hostname=vdtb4.ft.grp (Nom du client)

ListenPort=10050

ListenIP=130.117.62.228 (Ip du client)

Edit Services file:

cat /etc/services | grep 10050
cat /etc/services | grep 10051

vim /etc/services

#Add the following rules at the end:
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp # Zabbix ports

Copy the init.d scripts:

cp /home/zabbix/zabbix-1.8/misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d

#Edit the script files:
vim /etc/init.d/zabbix_agentd_ctl

#Change:
#BASEDIR=/opt/zabbix
BASEDIR=/usr

#ZABBIX_AGENTD=$BASEDIR/bin/zabbix_agentd
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd

Set the correct rights and set zabbix to start automatically:

ll /etc/init.d/zabbix_agentd_ctl
chmod 755 /etc/init.d/zabbix_agentd_ctl
update-rc.d zabbix_agentd_ctl defaults

#Start the agent:
./zabbix_agentd_ctl start

#Check if the Agent is running:
ps aux | grep -v grep | grep zabbix_agentd

zabbix 3479 0.0 0.0 2748 536 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd
zabbix 3480 0.0 0.0 2748 764 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd
zabbix 3481 0.0 0.0 2748 420 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd
zabbix 3482 0.0 0.0 2748 420 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd
zabbix 3483 0.0 0.0 2772 768 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd
zabbix 3484 0.0 0.0 2780 772 ? SN 10:21 0:00 /usr/sbin/zabbix_agentd

Test the proper operation of the agent.

Connect on vmoni with root account.

cd /usr/local/bin

root@vmoni:~# zabbix_get -p 10050 -k agent.version -s servername

1.8.5

Must return the version of the zabbix agent.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *