You are here

Installing Zabbix on CentOS

Zabbix is an enterprise-class open source software for monitoring of networks and applications. It is designed to monitor and track the status of various network services, servers and applications. It offers advanced monitoring, alerting, and visualization features. This is a step by step guide on "Installing Zabbix on CentOS" for MySQL monitoring. Monitoring mysql will be posted in seperate article. Install Apache httpd [root@localhost ~]# yum -y install httpd Start httpd service [root@localhost ~]# /etc/init.d/httpd start [ OK ] [root@localhost ~]# ps -ef | grep http root 2011 1 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2013 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2014 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2015 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2016 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2017 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2018 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2019 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd apache 2020 2011 0 11:46 ? 00:00:00 /usr/sbin/httpd Location of httpd error & configuration file [root@localhost ~]# cat /var/log/httpd/error_log [root@localhost ~]# cat /etc/httpd/conf/httpd.conf Now, apache should be working fine. Install PHP and it's extension [root@localhost ~]# yum -y install php [root@localhost ~]# yum -y install php-mysql PHP configuration file [root@localhost ~]# cat /etc/php.ini Install MySQL Server [root@localhost ~]# yum -y install mysql-server mysql mysql-devel [root@localhost ~]# /etc/init.d/mysqld start MySQL configuration and error log file [root@localhost ~]# cat /etc/my.cnf [root@localhost ~]# cat /var/log/mysqld.log Verification of apache, php and mysql Create a 'phpinfo.php' file and copy and paste the following line into it: Zabbix Installations Installing php extensions [root@localhost ~]# yum -y install php-bcmath [root@localhost ~]# yum -y install php-xml [root@localhost ~]# yum -y install php-mbstring Server Requirement Description OpenIPMI Required for IPMI support. libssh2 Required for SSH support. Version 1.0 or higher. fping Required for ICMP ping items. libcurl Required for web monitoring. libiksemel Required for Jabber support. net-snmp Required for SNMP support. [root@localhost ~]# yum install OpenIPMI libssh2 fping libcurl net-snmp gcc automake curl-devel net-snmp-devel OpenIPMI-devel [root@localhost ~]# wget http://dag.wieers.com/rpm/packages/iksemel/iksemel-1.4-1.el6.rf.i686.rpm [root@localhost ~]# wget http://dag.wieers.com/rpm/packages/iksemel/iksemel-devel-1.4-1.el6.rf.i6... [root@localhost ~]# rpm -ivh iksemel-1.4-1.el6.rf.i686.rpm warning: iksemel-1.4-1.el6.rf.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY Preparing... ########################################### [100%] 1:iksemel ########################################### [100%] [root@localhost ~]# rpm -ivh iksemel-devel-1.4-1.el6.rf.i686.rpm warning: iksemel-devel-1.4-1.el6.rf.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY Preparing... ########################################### [100%] 1:iksemel-devel ########################################### [100%] [root@localhost ~]# Download zabbix source. [root@localhost ~]# wget http://ncu.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.... [root@localhost ~]# ls -ltrh zabbix* -rw-r--r--. 1 root root 13M Apr 22 08:34 zabbix-2.0.6.tar.gz [root@localhost ~]# Extract the source [root@localhost ~]# tar -zxvf zabbix-2.0.6.tar.gz User account for zabbix [root@localhost ~]# groupadd zabbix [root@localhost ~]# useradd -g zabbix zabbix Creating user and database in mysql mysql> create database zabbix character set utf8; Query OK, 1 row affected (0.01 sec) mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix'; Query OK, 0 rows affected (0.02 sec) Loading data into mysql [root@localhost zabbix-2.0.6]# ls -ltrh database/mysql/ total 2.8M -rw-rw-r--. 1 1000 1000 1.9M Apr 22 08:31 images.sql -rw-rw-r--. 1 1000 1000 96K Apr 22 08:32 schema.sql -rw-rw-r--. 1 1000 1000 782K Apr 22 08:32 data.sql [root@localhost zabbix-2.0.6]# mysql -uzabbix -pzabbix zabbix AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Order allow,deny Allow from all Order deny,allow Deny from all PHP Tuning [root@localhost html]# vi /etc/php.ini max_execution_time = 300 date.timezone =Asia/Calcutta memory_limit = 256M post_max_size = 32M [root@localhost html]# /etc/init.d/httpd restart Setup Web Frontend Step:1 In browser, open Zabbix URL: http:///zabbix and follow the screen steps to complete the zabbix installation.