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
yum install httpd httpd-devel
yum install mysql mysql-server
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
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.
rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/7/x86_64/zabbix-release-2.2-1.el7.noarch.rpm
rpm -Uvh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
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';
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
Zabbix Setup Welcome Screen
Following is the welcome screen of Zabbix web installer. Click onÃÂ NextÃÂ to proceed.
If everything is ok, clickÃÂ Next to proceed.
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.
Zabbix Server Details
Click onÃÂ Next to proceed.
Pre-Installation Summary Screen
If all information is correct, click onÃÂ NextÃÂ to proceed.
Click onÃÂ FinishÃÂ to proceed.
Zabbix Login Screen
You can now loginÃÂ to Zabbix via the following url
Default username and password is as follows
Username: admin Password: zabbix
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.