Install Zabbix Server on CentOS/RHEL

by | 15 Aug 2015 | CentOS, Database, Linux, Monitoring, MySQL, OS, PHP, RHEL, Server, Technology, Zabbix, Zabbix Agent, Zabbix Server | 0 comments

Zabbix is an open source software for application and network monitoring. There are two types of Zabbix installation, namely Zabbix server and Zabbix agent. Zabbix server is installed on the server where you will oversee and monitor all the networks or devices. Zabbix agent is installed on all networks or devices so that the Zabbix server is able to communicate with it.

This tutorial guides you step by step on how to install and configure a Zabbix server on CentOS/RHEL server.

1. Set up Apache, MySQL and PHP

Install Apache

 yum install httpd httpd-devel

Install MySQL

yum install mysql mysql-server

Install PHP

yum install php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml

Start Apache and MySQL services

service httpd start
service mysqld start

Setup MySQL by running the following command

mysql_secure_installation

2. Configure Yum Repository

RPM repository needs to be configured before installing Zabbix.

Run the following commands according to the version of OS that you are using.

CentOS/RHEL 7

rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm

CentOS/RHEL 6

rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

CentOS/RHEL 5

rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/5/x86_64/zabbix-release-2.2-1.el5.noarch.rpm

3. Install Zabbix Server with MySQL

Command to install zabbix server

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

4. Setup Zabbix Apache Configuration

Locate Zabbix’s own Apache configuration file. By default it should be located at /etc/httpd/conf.d/zabbix.conf. Modify the config file by added your time zone.

sudo nano /etc/httpd/conf.d/zabbix.conf

Added time zone to config file

php_value date.timezone Asia/Singapore

Restart Apache service after changing the time zone value

service httpd restart

5. Create Zabbix MySQL Database

Zabbix MySQL user and database is required as part of Zabbix server installation.

Login to your MySQL first

mysql -u root -p

After which you will be prompt to enter your root password that you have configured previously when you setup MySQL.

Create Zabbix database

CREATE DATABASE zabbix CHARACTER SET UTF8;

Create Zabbix MySQL user to access Zabbix database

CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';

Grant privileges to Zabbix user on Zabbix database

GRANT ALL PRIVILEGES on zabbix.* to 'zabbix'@'localhost' IDENTIFIED BY 'password';

Flush privileges

FLUSH PRIVILEGES;

Exit MySQL

quit

After creating MySQL user and database for Zabbix, you will need to restore the default MySQL database provided by Zabbix. The files can be found at /usr/share/doc/zabbix-server-mysql-<version>/create/ directory.

Note: remember to change the version accordingly to the version that you are installing.

mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/schema.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/images.sql
mysql -u zabbix -p zabbix < /usr/share/doc/zabbix-server-mysql-2.2.8/create/data.sql

6. Start Zabbix Server

Command to start Zabbix server

service zabbix-server start

7. Start Zabbix Web Installer

You can now access your Zabbix web installer via the following url

http://<IP ADDRESS/URL>/zabbix/

Zabbix Setup Welcome Screen

Following is the welcome screen of Zabbix web installer. Click on Next to proceed.

Screen Shot 2015-08-15 at 11.55.34 am

Installation pre-requisites

If everything is ok, click Next to proceed.

Screen Shot 2015-08-15 at 11.57.54 am

Configure Database Connection

Enter the database information that you have created previously. Then click on Test Connection. If everything is correct, click Next to proceed.

Screen Shot 2015-08-15 at 12.00.35 pm

Zabbix Server Details

Click on Next to proceed.

Screen Shot 2015-08-15 at 12.01.46 pm

Pre-Installation Summary Screen

If all information is correct, click on Next to proceed.

Screen Shot 2015-08-15 at 12.12.48 pm

Installation Success

Click on Finish to proceed.

Screen Shot 2015-08-15 at 12.03.40 pm

Zabbix Login Screen

You can now login to Zabbix via the following url

http://<IP ADDRESS/URL>/zabbix/

Default username and password is as follows

Username: admin
Password: zabbix

Screen Shot 2015-08-15 at 12.15.08 pm

 

 

That’s it! You are done installing Zabbix server on your server. For installation of Zabbix agent, you can refer to my guide on how to install Zabbix agent on CentOS/RHEL.

Feel free to email me at [email protected] if you have any questions.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Related Posts

BrowserGoogle ChromeProgrammingTechnology
[Google Chrome Developer Ti] Prevent Warning "Your connection is not private" from appearing 5
[Google Chrome Developer Tip] Prevent Warning “Your connection is not private” from appearing

[Google Chrome Developer Tip] Prevent Warning “Your connection is not private” from appearing

This is probably more applicable to web developers. Many times when we try to run a localhost site with https in our local environment to emulate the production environment as close as possible, we will always run into a Google Chrome warning message "Your...

AndroidAppleBrowserGoogle ChromeInternet ExplorerLinuxMicrosoft EdgeMobile PhonesMozilla FirefoxOSSafariTechnology
How to do a hard refresh for Chrome, Safari, Firefox, Internet Explorer or Edge in Windows & Mac?

How to do a hard refresh for Chrome, Safari, Firefox, Internet Explorer or Edge in Windows & Mac?

Browser Hard Refresh in Google Chrome, Safari, Mozilla Firefox, Internet Explorer and Microsoft Edge Sometimes just by refreshing your browser alone doesn't help in letting you see the latest changes of a website. Any web developers will know this best. So below...

Amazon Web Services (AWS)Elastic BeanstalkServer
Unable to delete AWS Elastic Beanstalk Environment "resource XX-XXXXXXX has a dependent object" - MervCodes
Unable to delete AWS Elastic Beanstalk Environment “resource XX-XXXXXXX has a dependent object”

Unable to delete AWS Elastic Beanstalk Environment “resource XX-XXXXXXX has a dependent object”

Unable to delete AWS Elastic Beanstalk Environment "resource XX-XXXXXXX has a dependent object" Problem You will usually get this error when you are trying to delete an Elastic Beanstalk environment. Solution As the message in the Events log states, the security...

DatabaseMagentoMySQLOpen SourcePHPPhpMyAdminTechnology
Magento 1.9 Fix for Sending Double Emails or Sending Email to Wrong Recipients

Magento 1.9 Fix for Sending Double Emails or Sending Email to Wrong Recipients

As we know, Magento uses a cron job system to send out email from core_email_queue table. There is an additional table called core_email_queue_recipients, which as the name states, will store all recipients for emails there. But these records do not get removed at...

ApacheCentOSLinuxOSServerTechnology
How to Setup Let's Encrypt FREE SSL Certificate on Centos 6 Apache using Certbot? | MervCodes
How to Setup Let’s Encrypt FREE SSL Certificate on Centos 6 Apache using Certbot?

How to Setup Let’s Encrypt FREE SSL Certificate on Centos 6 Apache using Certbot?

Having SSL on your website these days is important especially if you want your website to rank better on Google search, and that's when Let's Encrypt come into the picture. Let's Encrypt is a free, automated, and open certificate authority (CA), run for the...