Friday, April 3, 2009

Cliffnotes: Zabbix 1.6.3 on CentOS 5.2

[root@crash ~]# useradd -r -c "Zabbix Monitoring" -d /opt/zabbix -m -s /sbin/nologin zabbix

[root@crash zabbix-1.6.3]# yum install mysql mysql-devel mysql-server net-snmp net-snmp-devel gnutls curl curl-devel OpenIPMI OpenIPMI-devel openldap-devel gcc make

If you want Jabber support, then download appropriate iksemel packages for your distro/architecture.

[root@crash ~]# wget

[root@crash ~]# wget

[root@crash ~]# rpm -ivh iksemel-devel-1.3-1.el5.rf.i386.rpm iksemel-1.3-1.el5.rf.i386.rpm

Create the ZABBIX database
[root@crash zabbix-1.6.3]# /usr/bin/mysqladmin -u root password 'changeme'

[root@crash zabbix-1.6.3]# mysql -uroot -p
Enter password:
mysql> create database zabbix;
Query OK, 1 row affected (0.00 sec)

mysql> quit;

Please note, to improve security create a dedicated zabbix mysql user with access to the zabbix schema. In my examples, I am using root, which is not recommended.
[root@crash schema]# cat mysql.sql | mysql -uroot -pchangeme zabbix
[root@crash zabbix-1.6.3]# cat create/data/data.sql | mysql -u root -pchangeme zabbix
[root@crash zabbix-1.6.3]# cat create/data/images_mysql.sql |mysql -u root -pchangeme zabbix

untar zabbix-src as zabbix user and run the following
[zabbix@crash zabbix-1.6.3]# ./configure --prefix=/opt/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber --with-libcurl --enable-agent --disable-ipv6 --with-ldap --with-openipmi

Sample configure output. YMMV.


Detected OS: linux-gnu
Install path: /opt/zabbix
Compilation arch: linux

Compiler: gcc
Compiler flags: -g -O2 -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -I/usr/include/rpm -I/usr/local/include -I/usr/include/gdbm -I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE -I. -I/usr/include/net-snmp -I/usr/include -I/usr/include

Enable server: yes
With database: MySQL
WEB Monitoring via: cURL
Native Jabber: yes
SNMP: net-snmp
IPMI: openipmi
Linker flags: -L/usr/lib -lldap -L/usr/lib -lOpenIPMI -lOpenIPMIposix -L/usr/lib/mysql -L/usr/lib -liksemel -L/usr/kerberos/lib -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lresolv -ldl -lidn -lssl -lcrypto -lz -L/usr/lib -lnetsnmp -lcrypto -lm -L/usr/lib/lib -lwrap -lcrypto -L/usr/lib -lnetsnmp -lcrypto -lm -L/usr/lib/lib -lwrap -lcrypto
Libraries: -lm -lresolv -lmysqlclient -liksemel -lcurl -lnetsnmp

Enable proxy: no

Enable agent: yes
Linker flags: -L/usr/lib -lldap -L/usr/lib -lOpenIPMI -lOpenIPMIposix
Libraries: -lm -lresolv

LDAP support: yes
IPv6 support: no

[zabbix@crash zabbix-1.6.3]$ make install

Append the following to /etc/services
zabbix-agent 10050/tcp #Zabbix Agent
zabbix-agent 10050/udp #Zabbix Agent
zabbix-trapper 10051/tcp #Zabbix Trapper
zabbix-trapper 10051/udp #Zabbix Trapper

Copy sample config files from zabbix-1.6.3/frontends
[zabbix@crash zabbix-1.6.3]$ cd misc/
[zabbix@crash misc]$ cp -a conf ~/etc

For convinience, I create a symlink in /etc
[root@crash ~]# ln -s /opt/zabbix/etc /etc/zabbix

If you plan to manage zabbix using the web front-end, install the following packages.
[root@crash zabbix-1.6.3]# yum install httpd php php-mysql php-gd php-bcmath

Modify the following variables in /etc/php.ini
max_execution_time = 300
date.timezone =

Setup webroot for zabbix web interface
[root@crash html]# mkdir zabbix
[root@crash html]# chown zabbix:zabbix zabbix

Copy the php files from zabbix source (zabbix-1.6.3/frontends)
[zabbix@crash zabbix-1.6.3]$ cd frontends
[zabbix@crash frontends]$ cp -a php/* /var/www/html/zabbix/
[zabbix@crash frontends]$ cd /var/www/html/zabbix/

Thats it! Start your web server and visit http://localhost/zabbix/index.php and go through the configuration wizard.

Also remember to start the zabbix server and agent as the zabbix user, not root.


No comments:

Post a Comment