In this tutorial, we will show you how to install Zabbix 3.4 on CentOS 7. Zabbix is an open source network monitoring software designed to monitor and track the status of various network devices, servers, virtual machines and other network hardware. It can use MySQL, PostgreSQL, SQLite, Oracle or IBM DB2 as a backend data storage. Zabbix back-end is written in C and the web front-end is written in PHP. Zabbix offers multiple monitoring options such as simple checks to verify the availability and responsiveness of standard services such as IMAP or HTTP without installing any software on the monitored machine.
A Zabbix agent can be deployed on a monitoring machines to monitor statistics such as CPU load, network utilization, disk space, etc. Zabbix’s client-server model allows allow us to collect rich sets of data that can be useful for monitoring the performance of the websites, services and various applications.
Installing Zabbix on CentOS, is fairly easy task and should not take more then 15 minutes. This guide should work on other Red Hat systems as well but was tested and written for CentOS 7 VPS. Let’s get started with installing Zabbix on your CentOS 7 server.
1. Install Apache and PHP
Installing Apache and PHP is pretty straightforward process, just issue the following command:
yum install httpd php
2. Install MariaDB
In this guide we will use MySQL/MariaDB as database engine. To install the MariaDB server, run:
yum install mariadb-server
When the installation is complete, run the following commands to start and enable the mariadb service run :
systemctl start mariadb systemctl enable = mariadb
To secure your installation and to setup the root password issue:
3. Install Zabbix on CentOS 7
Zabbix packages are not available in the default CentOs 7 repositories so first we need to install the official Zabbix repository for CentOS and then install all the necessary Zabbix packages. Run the following command to install the Zabbix 3.4 repository:
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
Once the repository is installed we can install the Zabbix server and the Zabbix web frontend with MySQL support using the following command:
yum install zabbix-server-mysql zabbix-web-mysql
The command above will also install all the necessary PHP packages.
4. Create a MySQL Database For Zabbix
To create a database and mysql user for our Zabbix installation run:
mysql -uroot -p MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8; MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'zabbix_passwd'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> \q
Next, we need to import the zabbix schema into the zabbix database. The command below will prompt you to enter the Zabbix mysql user password:
zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz | mysql -u zabbix -p zabbix
We also need to configure Zabbix to use the newly created database. Open the zabbix configuration file:
and set the zabbix database password:
### Option: DBPassword # Database password. Ignored for SQLite. # Comment this line if no password is used. # # Mandatory: no # Default: DBPassword=zabbix_passwd
The database name and the database user are already set to zabbix by default.
5. Configure PHP For Zabbix
Open the Zabbix PHP configuration file
uncomment the date.timezone line and set your timezone, in our case that is America/Chicago
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value always_populate_raw_post_data -1 php_value date.timezone America/Chicago
restart the apache service for changes to take effect:
systemctl restart httpd
6. Start the Zabbix server
Now when all other services are installed and configured we can start the Zabbix server with the following command:
systemctl start zabbix-server
To check if the service is started and running properly run:
systemctl status zabbix-server
The output should look like the following:
● zabbix-server.service - Zabbix Server Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled) Active: active (running) since Fri 2018-04-13 12:22:30 CDT; 1min 14s ago Process: 6451 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS) Main PID: 6453 (zabbix_server)
7. Access the Zabbix Web Interface
In the last step of this guide we need to access to Zabbix Web Interface and finish the installation.
To finish the installation open your browser and navigate to
http://your_server_ip_address/zabbix/. The installer will ask you to enter the zabbix database login information and once you finish the post installation steps you will be redirected to the Zabbix Web Interface login page. The default admin user name is ‘admin’ and the password is ‘zabbix’.
That’s it. You have successfully installed Zabbix 3.4 server on your CentOS 7 VPS. For more information about how to manage your Zabbix installation, please refer to the official Zabbix documentation.
Of course you don’t have to Install Zabbix on your CentOS 7 server, if you use one of our Linux Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.
PS. If you liked this post, on How To Install Zabbix 3.4 on CentOS 7, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.