You are on page 1of 6

INSTALLATION MANUAL

By: Gohar Ahmed

NOTE: Do Not Blindly follow this manual, use some brain of yours too. There may be changes in your
settings.

Find all the necessary packages.

rpm -q ntp php php-bcmath php-gd php-mysql httpd mysql gcc mysql-server mysql-
devel net-snmp net-snmp-utils net-snmp-devel net-snmp-libs curl-devel mak

Install all the necessary packages.(Only those which are not already installed, else these will be updated
which isn't bad though. )

yum -y install ntp php php-bcmath php-gd php-mysql httpd mysql gcc mysql-server
mysql-devel net-snmp net-snmp-utils net-snmp-devel net-snmp-libs curl-devel mak

Start up the time server. its important for the time between your devices to be in sync. (optional)

/etc/init.d/ntpd start

Download fPing, and install it:

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 755 /usr/sbin/fping

Create Zabbix user.

useradd zabbix

Download zabbix and untar it.

ZABBIX:1.82

wget http://prdownloads.sourceforge.net/zabbix/zabbix-1.8.2.tar.gz?download

ZABBIX:1.81

wget http://prdownloads.sourceforge.net/zabbix/zabbix-1.8.1.tar.gz?download

tar -xzvf zabbix-1.8.1.tar.gz

Start MySQL, and change the root password.

/etc/init.d/mysqld start

/usr/bin/mysqladmin -u root password YourFancyNewRootPassword


Connect to the DB using your newly created root password. Create the zabbix DB, and assign a new user
(zabbixi2cga) with privileges to that DB. You may want to change “zabbixmysqlpassword” to something else.
But it should not be the same as any other “critical” password because it will be stored plain text in a config
file.

mysql -u root -p

mysql> CREATE DATABASE zabbix;

mysql> GRANT DROP,INDEX,CREATE,SELECT,INSERT,UPDATE,ALTER,DELETE ON


zabbix.* TO zabbixi2cga@localhost IDENTIFIED BY 'zabbixmysqlpassword';

mysql> quit;

Create the DB Schema

cd zabbix-1.8.1

cat create/schema/mysql.sql | mysql -u zabbixi2cga -pzabbixmysqlpassword zabbix

cat create/data/data.sql | mysql -u zabbixi2cga -pzabbixmysqlpassword zabbix

cat create/data/images_mysql.sql | mysql -u zabbixi2cga -pzabbixmysqlpassword zabbix

Server only compilation

./configure -enable-server -prefix=/usr/local/zabbix -with-mysql -with-net-snmp


-with-libcurl

make install

make clean

Agent only Compilation

./configure -enable-agent -prefix=/usr/local/zabbix -enable-static

make install

Add the zabbix server and agent ports to your /etc/services file.

echo 'zabbix_agent 10050/tcp' >> /etc/services

echo 'zabbix_trap 10051/tcp' >> /etc/services

Copy the sample configs 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
in /etc/zabbix/zabbix_server.conf, modify:

DBUser=zabbixi2cga

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=EnterAUniqueHostNameForEachAgent

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 (Note the # hash marks, they are necessary), add near the top, just below
#!/bin/sh:

#chkconfig: 345 95 95
#description: Zabbix Agentd

in /etc/init.d/zabbix_server (again, note the # Hash marks, they are required), add near the top, just
below #!/bin/sh:

# chkconfig: 345 95 95
# description: Zabbix Server

Configure automatic starting and stopping of services.

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

/etc/init.d/iptables stop
Note: I turn the iptables firewall OFF because my box is behind a firewall. You should consult with your
network folks before turning off the firewall. At the very least you should poke holes for port 80, 10050, and
10051 in the firewall.

cp -r frontends/php /var/www/html/zabbix

in /etc/php.ini, modify:

max_execution_time = 300

post_max_size = 32M

mbstring.func_overload = 7

memory_limit = 256M

date.timezone = America/Los_Angeles

Note: Obviously you should substitute your own time zone. For a list of all valid timezones, click here

/etc/init.d/httpd start

chmod 777 /var/www/html/zabbix/conf

Launch http://your.servers.name/zabbix inyour browser. You should be prompted with a setup screen.
Click through the user agreement, and when you get to the Pre requisites screen, make sure you have a
green OK next to everything.
When you’ve finished walking through the web interface setup:

chmod 755 /var/www/html/zabbix/conf

mv /var/www/html/zabbix/setup.php /var/www/html/zabbix/setup.php.bak

ln -s /usr/local/zabbix/sbin/zabbix_agentd /usr/local/zabbix/bin/zabbix_agentd

Same line as above for zabbix_server binary

/etc/init.d/zabbix_agentd start

/etc/init.d/zabbix_server start

You can now login to your zabbix installation by going to http://your.server.name/zabbix, using the
username “admin”, with zabbix.

For Reference, your binaries are under /usr/local/zabbix/bin, and your configuration files are in /etc/zabbix.

References:: http://www.zabbix.com/documentation.php .

You might also like