See for the official Zabbix site.

Docs/howto/Install Zabbix with IBM DB2

Jump to: navigation, search

Installing DB2 express


# cat /etc/SuSE-release
 SUSE Linux Enterprise Server 11 (x86_64)
# db2level
 DB21085I  This instance or install (instance name, where applicable: 
 "db2inst1") uses "64" bits and DB2 code release "SQL10051" with level 
 identifier "0602010E".
 Informational tokens are "DB2 v10.5.0.1", "special_31160", "IP23526_31160", and 
 Fix Pack "1".

Installing DB2

Install packages:

# zypper in -y gcc make automake autoconf pkg-config glibc-devel libopenssl-devel zlib-devel

Download Zabbix sources form and extract it:

# pwd
# wget*/zabbix-2.2.*.tar.gz/download
# tar -zxvf zabbix-2.2.*.tar.gz

Download DB2 from IBM page and extract it:

# tar -zxvf v10.5fp1_linuxx64_expc.tar.gz
# cd expc/

Check requirements:

# db2prereqcheck

Start instalation:

# ./db2_install
 Install into default directory (/opt/ibm/db2/V10.5) ? [yes/no]

Create user groups:

# groupadd -g 999 db2iadm1
# groupadd -g 998 db2fadm1
# groupadd -g 997 dasadm1

Create users:

# useradd -u 1001 -g db2iadm1 -m -d /home/db2inst1 db2inst1
# useradd -u 1002 -g db2fadm1 -m -d /home/db2fenc1 db2fenc1
# useradd -u 1003 -g dasadm1 -m -d /home/dasusr1 dasusr1

Set passwords:

# passwd db2inst1
# passwd db2fenc1
# passwd dasusr1
# cd /opt/ibm/db2/V10.5/instance/

Create instances:

# ./dascrt -u dasusr1
# ./db2icrt -a server -u db2fenc1 db2inst1

Add links:

# ../cfg/db2ln

Start DB2:

$ su - db2inst1
$ db2start

Create Zabbix database

$ db2 "create database zabbix using codeset utf-8 territory us pagesize 32768"
$ cd /tmp/zabbix-2.2.*/database/ibm_db2/
$ db2batch -d zabbix -f schema.sql
$ db2batch -d zabbix -f images.sql
$ db2batch -d zabbix -f data.sql

Configure DB2

$ db2set DB2COMM=TCPIP
$ db2 update dbm cfg using svcename 47811
$ db2stop
$ db2start
$ exit

Install Zabbix server and agent

Add zabbix user:

# groupadd zabbix
# useradd -g zabbix zabbix
# cd /tmp/zabbix-2.2.*/

Install additional packages:

# zypper in -y unixODBC unixODBC-devel OpenIPMI OpenIPMI-devel libxml2 libxml2-devel libcurl-devel libssh2 libssh2-devel openldap2 openldap2-devel net-snmp-devel net-snmp

Configure sources and install Zabbix

# ./configure --enable-server --enable-agent --enable-ipv6 --with-ibm-db2 --with-net-snmp --with-libcurl --with-unixodbc --with-openipmi --with-ldap --with-libxml2 --with-ssh2
# make && make install

Create start scripts:

# cp ./misc/init.d/suse/9.3/zabbix_* /etc/init.d/
# ln -s /etc/init.d/zabbix_server /usr/sbin/rczabbix_server
# ln -s /etc/init.d/zabbix_agentd /usr/sbin/rczabbix_agentd
# chmod +x /etc/init.d/zabbix_*

Enable autostart:

# chkconfig -a zabbix_agentd
# chkconfig -a zabbix_server
# chkconfig -a apache2

Configure Zabbix server

# vi /usr/locat/etc/zabbix_server.conf
 # DBSchema=
 # DBSocket=

Start Zabbix server and agent:

# rczabbix_server start
# rczabbix_agentd start

Check Zabbix server log file.

Install frontend

Install additional packages:

# zypper in -y apache2 apache2-mod_php53 php53-gd php53-sockets php53-bcmath php53-mbstring php53-ldap php53-gettext php53-pear php53-devel

Add DB2 home directory to environment variables and install ibm_db2 extension:

# export IBM_DB_HOME=/opt/ibm/db2/V10.5/
# pecl install ibm_db2
 DB2 Installation Directory? :

Add extension to php.ini under "Dynamic Extensions" section:

# vi /etc/php5/apache2/php.ini

Update values for php parameters in php.ini:

 max_execution_time = 300
 max_input_time = 300
 post_max_size = 16M
 date.timezone = Europe/Riga

Copy frontend files:

cd ./frontends/php/
mkdir /srv/www/htdocs/zabbix
cp -a . /srv/www/htdocs/zabbix

Restart web server:

rcapache2 restart

Open frontend "http://server_IP/zabbix" and finish installation (