Tuesday, August 30, 2011

Zabbix Agent Install Notes for RHEL5

Zabbix Agent Install Notes for RHEL5

Base Source: http://systembash.com/content/installing-and-compiling-zabbix-client-agent/

# Download zabbix source code from www.zabbix.com; decompress with ‘tar zxvf’ and cd to directory

# Configure the make program:

./configure –enable-agent

# Compile and install the program: make install

# Add zabbix group and user (you may change the password RANDOMPASS with your own Random Password):

groupadd zabbix; adduser -g zabbix -s /sbin/nologin -M -p RANDOMPASS zabbix

# Create log file (note that this is actually two commands):

touch /var/log/zabbix_agentd.log; chown zabbix.zabbix /var/log/zabbix_agentd.log

# Copy init script to /etc/init.d. Scripts are located in ./misc/init.d/ and your distro directory

cp /zabbix-1.8.6/misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d/zabbix_agentd
chmod a+x /etc/init.d/zabbix_agentd

#locate zabbix_agentd

find where the binary is located and change the progdir variable in the init script

nano /etc/init.d/zabbix_agentd

replace progdir="/usr/local/sbin/"
like:
progdir="/usr/local/sbin/"_agentd


you can just press enter and comment out like this:
#"/usr/local/zabbix/bin/"

# you can also change the hostname

Hostname=rhel5hostest
#AGENTHOSTNAME


# chkconfig zabbix_agentd on

# Copy agent config script to /etc/zabbix/zabbix_agentd.conf. Current one is:

# This is config file for zabbix_agentd
# To get more information about ZABBIX, go http://www.zabbix.com

# This is the ip and port of the main zabbix server
Server=10.0.0.1 (you need to change this!)
ServerPort=10051
Hostname=AGENTHOSTNAME (you might want to change this as well!)
ListenPort=10050
# ListenIP=10.0.0.2
StartAgents=5
DisableActive=1
DebugLevel=1
PidFile=/var/tmp/zabbix_agentd.pid
# LogFile=/var/log/zabbix_agentd.log (you have to uncomment this)
LogFileSize=1
Timeout=10

create directory: mkdir /etc/zabbix
touch /etc/zabbix/zabbix_agentd.conf
nano /etc/zabbix/zabbix_agentd.conf

# Start the zabbix service: service zabbix_agentd start
# Open firewall for zabbix port (10050) if necessary.
# Log into Zabbix on the server, Add server to hosts – use correct templates and groups depending on what type of server it is.
# Add monitoring and notification as appropriate.
# Consider if all necessary services are being monitored; test that detection of down services and notifications work properly.


e.g. http://192.168.5.126/zabbix/