Installing Zabbix 2.0 package from EPEL on CentOS 6.4

As promised from my previous post on Installing CentOs on VirtualBox, this post will be focused on step by step installation guide of Zabbix on CentOS. As at the writing of this post, Zabbix v2.0 and CentOS v6.4 where the latest. It is assumed that you already have CentOS 6.4 installed and configured.

[box type=”info” size=”medium” style=”rounded” icon=”info”]Update: Added steps on how to open up zabbix ports in a production environment without having to disable IPTABLES[/box]

Setup:

1: Download Package

– # rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm

zabbix

2: Install zabbix server packages

– # yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-java-gateway

zabbix-update08

Note: Type y during each prompt to install the packages

3: Install MySQL Database

Type y during prompt

– # yum install mysql-server

zabbix-update01

– Start mysql service with command “service mysqld start

– Run the secure installation command “mysql_secure_installation” to set the root password:

– Enter current password for root (enter for none):
Set root password? [Y/n] 
– Remove anonymous users? [Y/n]
– Disallow root login remotely? [Y/n]
– Remove test database and access to it? [Y/n]
– Reload privilege tables now? [Y/n]

4: Create zabbix database

– Enter following commands to setup the database:

– # mysql -uroot -p<enter root password>
– mysql> create database zabbix character set utf8;
– mysql> grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix’;
– mysql> exit

zabbix-update02

5: Import initial schema and data

– # cd /usr/share/doc/zabbix-server-mysql-2.0.10/create
– # mysql -uroot -p<enter root password> zabbix < schema.sql
– # mysql -uroot -p<enter root password> zabbix < images.sql
– # mysql -uroot -p<enter root password> zabbix < data.sql

zabbix-update03a

6: Edit database configuration in zabbix_server.conf

– # vi /etc/zabbix/zabbix_server.conf

Confirm following lines:

– DBHost=localhost (uncomment this line)
– DBName=zabbix
– DBUser=zabbix
– DBPassword=zabbix (uncomment this line)

7: Start zabbix server / agent services

– # service zabbix-server start
– # service zabbix-agent start

zabbix-update09

8: Change Timezone

– # vi /etc/httpd/conf.d/zabbix.conf

Uncomment below line and change to desired timezone

– # php_value date.timezone Europe/London

9: Restart the apache web server

– # service httpd restart

10: Set zabbix services to start on reboot

– # chkconfig zabbix-server on
– # chkconfig zabbix-agent on
– # chkconfig mysqld on
– # chkconfig httpd on

11: Configure Firewall

Before you can access the Front-end interface, you either disable the Firewall (IPTABLES) or add rules for zabbix ports.

In Test Lab:

Only disable iptables firewall if testing this in a lab by running the command ‘service iptables stop‘ to stop the service and use ‘service iptables status‘ to confirm its not running

zabbix

In Production Environment:

Add the following lines in iptables for Trapper (10051); Client (10050) & httpd (80)

[code lang=”js”]

vi /etc/sysconfig/iptables

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 10050 -j ACCEPT

-A INPUT -m state –state NEW -m tcp -p tcp –dport 10051 -j ACCEPT

[/code]

Restart the Firewall

[code lang=”js”]service iptables restart[/code]

12: Configure Zabbix Web interface

–  Enter the following URL on a browser to access the zabbix web interface ‘http:///zabbix

zabbix

– Click Next and make sure all checks are OK

zabbix

– Change the Database username and password to ‘zabbix‘ and click Test connection to ensure connection is established. Note here that we are using the default zabbix password which isn’t secured. In my later post, I will show you how to change the Zabbix database password to a more secured password

zabbix-update04

– Leave host name and port as default

zabbix-update05a

– Confirm all settings are right

zabbix-update06a

– Click Finish to complete configuration

zabbix

Log into zabbix with default credentials (u: Admin, P: zabbix) and there you are a nice looking shiny HomePage 🙂

– Click profile on top right hand corner, click Change password and complete the change password process

zabbix

There we are all done :). Feel free share your install experience 🙂

 
comments powered by Disqus