0

Zabbix Network Monitoring Tool Installation

Friday, January 18, 2008

First of all make sure that you have the following installed in your machine.
http, mysql, gcc, mysql-server, mysql-devel, net-snmp, net-snmp-utils, net-snmp-devel, net-snmp-libs, curl-devel, mak, ntp, php (php with bcmath,gd and mysql support)

You can install this using "yum -y install PACKAGENAME"

Start up the time server this for syncing the time between devices:
/etc/init.d/ntpd start

Download and install fPing:
wget http://dag.wieers.com/rpm/packages/fping/fping-2.4-1.b2.2.el5.rf.i386.rpm
rpm -Uvh fping-2.4-1.b2.2.el5.rf.i386.rpm
chmod 7555 /usr/sbin/fping


Create Zabbix user.
useradd zabbix
Download zabbix and untar it.
wget http://superb-east.dl.sourceforge.net/sourceforge/zabbix/zzabbix-1.4.4.tar.gz
tar -xzvf zabbix-1.4.4.tar.gz



Grant zabbix database access to corresponding user:
mysql -u root -p
mysql> CREATE DATABASE zabbix;
mysql> GRANT DROP,INDEX,CREATE,SELECT,INSERT,UPDATE,ALTER,DELETE ON zabbix.* TO zabbixmysqluser@localhost IDENTIFIED BY ‘zabbixmysqlpass’;
mysql> quit;


Create the DB Schema
cd zabbix-1.4.4
cat create/schema/mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbix
cat create/data/data.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbix
cat create/data/images_mysql.sql | mysql -u zabbixmysqluser -pzabbixmysqlpass zabbix


configuring zabbix server:
./configure –enable-server –prefix=/usr/local/zabbix –with-mysql –with-net-snmp –with-libcurl
make install
make clean


Compile the zabbix agent:
./configure –enable-agent –prefix=/usr/local/zabbix –enable-static
make install


Add the zabbix server and agent ports to /etc/services file.
echo "zabbix_agent 10050/tcp" >> /etc/services
echo "zabbix_trap 10051/tcp" >> /etc/services


Copy the sample .conf files to /etc/zabbix for server and agentd.
mkdir /etc/zabbix
cp misc/conf/zabbix_agentd.conf /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix


Modify the .conf files as per the requirement. In /etc/zabbix/zabbix_server.conf, modify:
DBUser=zabbixmysqluser
BPassword=zabbixmysqlpassword
DBSocket=/var/lib/mysql/mysql.sock
FpingLocation=/usr/sbin/fping


In /etc/zabbix/zabbix_agentd.conf, modify:
Server=127.0.0.1,Your.Zabbix.Server.IP
Hostname=EnterTheHostName
cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/zabbix_agentd
cp misc/init.d/redhat/zabbix_server_ctl /etc/init.d/zabbix_server


In /etc/init.d/zabbix_agentd AND /etc/init.d/zabbix_server:
BASEDIR=/usr/local/zabbix

In /etc/init.d/zabbix_agentd, add near the top, just below #!/bin/sh:
# chkconfig: 345 95 95
# description: Zabbix Agentd


In /etc/init.d/zabbix_server, just below #!/bin/sh add the following:
# chkconfig: 345 95 95
# description: Zabbix Server

Automatic starting and stopping of services configuration:
chkconfig –level 345 zabbix_server on
chkconfig –level 345 zabbix_agentd on
chkconfig –level 345 httpd on
chkconfig –level 345 mysqld on
chkconfig –level 0123456 iptables off


Make sure that connection to 10050, and 10051 possible. check the firewall setting also.

Move the zabbix frontend file to relevant DocumentRoot:
cp -r frontends/php /var/www/html/zabbix

in /etc/php.ini, modify:
max_execution_time = 300
date.timezone = Asia/Calcutta


Note: Substitute relevant timezone. You can obtain the timzone name from http://us2.php.net/manual/en/timezones.america.php.

Start the apache for the changes to get effect:
/etc/init.d/httpd start

To execute the LICENSE
chmod 777 /var/www/html/zabbix/conf

Access the URL http://HOSTNAME/zabbix and follow the instrustions.

After the installation do the following:
chmod 755 /var/www/html/zabbix/conf
mv /var/www/html/zabbix/setup.php /var/www/html/zabbix/setup.php.bk
/etc/init.d/zabbix_agentd start
/etc/init.d/zabbix_server start


If you find that http://HOSTNAME/zabbix/ is not displaying, check whether the php-pear module installed or not. Also check the errorlog to get the exact error message. You can install it using "yum -y install php-pear"

Refer the tutorial to get more information regarding its working:
http://www.zabbix.com/manual/v1.1/qs.host.agent.php

You can login into the Admin are using "admin" as user name. There is no password required for it. The password reset can be done after login into it.