How To Install Zabbix Server 3.4 on CentOS 7 / RHEL 7

1

Zabbix is an enterprise-class monitoring solution for servers, network devices, and other components of your infrastructure.

Zabbix uses client (Zabbix Agent) installed on the monitored client-server to collect the data. Also, it can monitor standard services such as e-mail, web service without installing a client on the monitored devices.

With Zabbix, you can monitor almost everything that is on your infrastructure. Since Zabbix is enterprise-ready, you can use Zabbix monitoring for environments ranging from small to larger.

Zabbix is free, released under the GPL license, so it is free commercial and non-commercial use.

Features of Zabbix

  • Monitor the metrics like CPU, memory, disk space, network and process of servers (Requires Zabbix Agent)
  • Monitoring of VMware vCeneter, VMware hypervisor, and virtual machines.
  • Automatically discovers VMware hypervisor and virtual machines using low-level discovery.
  • Monitoring of MySQL, PostgreSQL, Oracle and Microsoft SQL Server.
  • Zabbix has built-in Java application server monitoring.
  • Monitoring the network device with SNMP.
  • Web services monitoring.
  • Hardware monitoring such as temperature, fan speed, and disk state.

More features.

In this guide, we will talk about installing Zabbix Server on CentOS 7 / RHEL 7.

System Requirements

Hardware

Zabbix requires at least 128MB memory and 256MB of disk space to start with. However, the amount of memory depends on the number of hosts and parameters are being monitored.

2GB RAM and 2GB of disk space would be sufficient to monitor 500 hosts

Software

Apache: 1.3.12 or later
MySQL: 5.0.3 or later
PHP: 5.4.0 or later

Install PHP and PHP Extensions

Install the required PHP extension using the following command.

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

Enable optional repository on RHEL 7.

yum-config-manager --enable rhel-7-server-optional-rpms

Configure Zabbix repository

Zabbix is not available in our base OS by default, so install Zabbix repository configuration package.

rpm -ivh https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

Install Zabbix Server with MySQL

Use the following command to install Zabbix server along with MySQL database support package on your system.

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb-server

Timezone

To begin using the Apache with Zabbix server. Zabbix configuration file needs to be updated with TimeZone.

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

Update the below line with correct timezone, more time zones.

php_value date.timezone America/New_York

Create Zabbix database

Start the MariaDB service.

systemctl start mariadb

Login to MariaDB and create the database and user for our Zabbix installation.

If you are starting/setting up MariaDB server for the first time then consider taking a look at Securing MariaDB, and this is to ensure the MariaDB instance has root password set, no anonymous users, disallow root login remotely, and removing test database.
mysql -u root -p

Create a database with the following details.

Example:

DBName = zabbixdb
DBUser = zabbixuser
DBPassword = password

mysql> create database zabbixdb character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbixdb.* to zabbixuser@localhost identified by 'password';
mysql> quit;

Once you are done creating the database for Zabbix installation, then import initial schema and data to the newly created database.

cd /usr/share/doc/zabbix-server-mysql*/
zcat create.sql.gz | mysql -u zabbixuser -p zabbixdb

Update Database Configuration

Edit the zabbix_server.conf file to set the database details.

vi /etc/zabbix/zabbix_server.conf

Make sure you set as follows.

DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password

SELinux (CentOS 7)

If you have SELinux enabled on your server, you need to run the following command to enable successful connection of Zabbix web frontend to the server.

yum install -y policycoreutils-python
setsebool -P httpd_can_connect_zabbix on

Also, add a few custom rules.

curl https://support.zabbix.com/secure/attachment/53320/zabbix_server_add.te > zabbix_server_add.te
checkmodule -M -m -o zabbix_server_add.mod zabbix_server_add.te
semodule_package -m zabbix_server_add.mod -o zabbix_server_add.pp
semodule -i zabbix_server_add.pp

Thanks to catonrug blog.

Services

Restart all the services.

systemctl restart zabbix-server 
systemctl restart httpd

Enable the service to start automatically on system reboot.

systemctl enable zabbix-server
systemctl enable httpd
systemctl enable mariadb

Firewall

Configure the firewall to allow Zabbix agent to reach Zabbix server.

firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
systemctl restart firewalld

Configure Zabbix via Web Installer

Open up your web browser and point it to the following URL.

http://your-ip-add-ress/zabbix/

Follow the below steps to complete the Zabbix installation.

Click Next Step on Zabbix welcome page.

Install Zabbix Server 3.4 on CentOS 7 - Installation Wizard
Install Zabbix Server 3.4 on CentOS 7 – Installation Wizard

This step verifies all the pre-requisites are met for Zabbix Installation. If there are any issues, this page will tell you what all the extension are missing. Click on Next Step.

Install Zabbix Server 3.4 on CentOS 7 - Pre-Installation Checks
Install Zabbix Server 3.4 on CentOS 7 – Pre-Installation Checks

Enter the Zabbix database name, DB user, and password. Click Next Step.

Install Zabbix Server 3.4 on CentOS 7 - Database ConfigurationMention the Zabbix server details, port number, and the name for Zabbix installation and then click Next step.

Install Zabbix Server 3.4 on CentOS 7 - Zabbix Server Details
Install Zabbix Server 3.4 on CentOS 7 – Zabbix Server Details

You will get a pre-installation summary like below. Click Next step.

Install Zabbix Server 3.4 on CentOS 7 - Zabbix Pre-Installation Summary
Install Zabbix Server 3.4 on CentOS 7 – Zabbix Pre-Installation Summary

Now, you have completed the installation of Zabbix. Click the Finish.

Install Zabbix Server 3.4 on CentOS 7 - Zabbix Installation Complete
Install Zabbix Server 3.4 on CentOS 7 – Zabbix Installation Complete

Once after you clicked on Finish, the installer will redirect you to the Zabbix web console.

Access Zabbix Dashboard

Log in with the Zabbix default username and password.

Username: Admin

Password: zabbix

Username is case sensitive.
Install Zabbix Server 3.4 on CentOS 7 - Zabbix Login Screen
Install Zabbix Server 3.4 on CentOS 7 – Zabbix Login Screen

Zabbix Dashboard:

Install Zabbix Server 3.4 on CentOS 7 - Zabbix Dashboard
Install Zabbix Server 3.4 on CentOS 7 – Zabbix Dashboard

Now, you can proceed to install Zabbix Agent and then add client node to Zabbix server for monitoring.

That’s All.

Further Reading

You might also like

How To Install Zabbix Server 3.4 on CentOS 7 / RHEL 7

1