This guide covers easily installing Zabbix 3.0 on CentOS 7 with a MySQL database back-end. No fuzz, just the basics to get things up and running.
Recently Zabbix 3.0 was released and with it came a ton of great new features as well as an overhaul of the web UI front-end which was badly needed.
If you’re new to Zabbix, this is the version you want to pick for a first time installation. Zabbix 3.0 will be supported far into the future and is the new recommended release to install.
If you’re taking your first steps into the world of monitoring, installing Zabbix can seem a daunting task. In this guide however, I’ve tried to cut down on any unnecessary “fuzz”. This means you won’t necessarily get a detailed description of why every step was performed the way it was. On the plus side, the guide was intended to be very easy to follow. What you’ll end up with though, is still a fully functional Zabbix 3.0 Server with a MySQL database back-end.
Note that MySQL has been replaced with MariaDB, a fork of MySQL. Excerpt from Wikipedia:
MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. It is notable for being led by the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle. Contributors are required to share their copyright with the MariaDB Foundation.
This guide is entirely written for CentOS 7. Currently, installing Zabbix 3.0 cannot easily be done on CentOS 6 using the Zabbix repositories. The Zabbix team is working on getting Zabbix 3.0 packages ready for CentOS 6.
Add the official Zabbix 3.0 CentOS 7 repositories
# rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
SELinux is a Linux kernel security module that is part of standard CentOS installations. The following should only be done in a test environment, as you would normally want to have SELinux properly configured. This guide won’t cover correctly setting up SELinux for your Zabbix Server, so for now, we’re going to disable it. :
# setenforce 0 # sed -i 's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
Installing Zabbix 3.0 Server, agent and web front-end
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
Install MariaDB Server, enable and start it
# yum -y install mariadb-server mariadb # systemctl enable mariadb.service # systemctl start mariadb.service
Secure your MariaDB installation
The script will ask you if you wish to change the root password of your MariaDB server. Answer ‘No’ for now, since this can be changed later. Answer ‘Yes’ to the remaining 4 questions. This will perform some basic hardening of your MariaDB server.
Create your Zabbix database and user
This will create your Zabbix database and a user called ‘zabbix’ with the <password> you specify. This user will be the one used by your Zabbix server and web front-end.
# mysql -uroot -p MariaDB> create database zabbix character set utf8 collate utf8_bin; MariaDB> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>'; MariaDB> quit;
Import initial schema and data
Zabbix needs to setup your ‘zabbix’ database correctly and also create tables for it to use.
# cd /usr/share/doc/zabbix-server-mysql-3.0.1 # zcat create.sql.gz | mysql -uroot zabbix
Configure Zabbix Server
# vi /etc/zabbix/zabbix_server.conf
Search for “DBPassword=”, remove the # at the start of the line and fill in the password you chose in step 6:
To save and exit, type:
Specify the timezone of your web front-end
# vi /etc/httpd/conf.d/zabbix.conf
On line 19, remove the ‘#’ from the start of the line and change the value to your timezone. A list of supported PHP timezone can be found here. Example: Europe/Copenhagen
To save and exit, type:
Enable and start your Zabbix Server, agent and HTTPD service
# systemctl enable zabbix-server # systemctl enable zabbix-agent # systemctl enable httpd # systemctl start zabbix-server # systemctl start zabbix-agent # systemctl start httpd
Verify that you can access your web front-end by opening a browser and pointing it to:
When you’ve successfully accessed your Zabbix web front-end, push ‘Next step’ to continue to pre-requisites check.
Front-end installation: Check of pre-requisites
If you’ve followed the steps outlined above, all values should return ‘OK’. Press ‘Next step’ to continue.
Front-end installation: Configure DB connection
Leave the default values. You only need to fill out the ‘password’ field with the <password> from step 6. Press ‘Next step’ to continue.
Front-end installation: Zabbix server details
Leave the default values. Optionally give your Zabbix server a name. Press ‘Next step’ to continue.
Front-end installation: Pre-installation summary
A summary of the settings you’ve chosen in the previous steps. Everything should be correct, so feel free to press ‘Next step’ to continue and perform the front-end installation.
You Zabbix Server and web front-end is now configured correctly. Press ‘Finish’ to be taken to the login page of your brand new Zabbix installation!
Congratulations! You have successfully installed your Zabbix Server and web front-end
The default super administrator login is: Admin / zabbix