Methods to Set up and Configure Zabbix on CentOS 7 13
0

Zabbix is an open supply monitoring device for community providers, community {hardware}, servers, and utility. Designed to trace and monitor the standing of your system and servers. Zabbix presents help for a lot of database programs – together with MySQL, PostgreSQL, SQLite, and IBM DB2  – to retailer information. Zabbix backend is written in C, and the frontend is written in PHP.

On this tutorial, we are going to present you step-by-step easy methods to set up and configure an open supply monitoring system Zabbix 3.Four on the CentOS 7 system. This information will cowl some subjects, together with set up and configuration of the LAMP Stack for our Zabbix set up, and easy methods to change the default password for Zabbix admin net UI.

Stipulations

  • CentOS 7 Server
  • Root privileges

What we are going to do?

  1. Set up Apache2/httpd on CentOS 7
  2. Set up and Configure PHP 7.2 on CentOS 7
  3. Set up and Configure MySQL
  4. Set up and Configure Zabbix 3.Four on CentOS 7
  5. Configure FirewallD
  6. Zabbix Preliminary-Setup
  7. Change Default Admin

Step 1 – Set up Apache2/httpd

On this information, we are going to run Zabbix below the Apache net server. The online server packages will be put in from the default CentOS 7 repository.

Set up Apache/httpd utilizing the yum command beneath.

sudo yum -y set up httpd

After the set up is full, begin the service and allow it to launch each time at system boot.

systemctl begin httpd
systemctl allow httpd

The Apache/httpd net server has been put in on the system – examine it utilizing the netstat command.

netstat -plntu

And you’re going to get the default HTTP port 80 within the LISTEN state.

Netstat command

Step 2 – Set up and Configure PHP 7.2 on CentOS 7

On this step, we are going to set up PHP 7 from a third-party repository – we are going to set up PHP 7.2 from the ‘webtatic’ repository.

Earlier than putting in PHP 7 with all extensions wanted, add the webtatic and the EPEL repository to the system.

Run instructions beneath.

yum -y set up epel-release
sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Now set up PHP 7.2 packages from the webtatic repository utilizing yum.

yum -y set up mod_php72w php72w-cli php72w-common php72w-devel php72w-pear php72w-gd php72w-mbstring php72w-mysql php72w-xml php72w-bcmath

And after the set up is full, we have to edit the default ‘php.ini’ file utilizing the vim editor.

vim /and many others/php.ini

Change the values of the configuration as proven beneath.

 max_execution_time = 600
max_input_time = 600
memory_limit = 256M
post_max_size = 32M
upload_max_filesize = 16M
date.timezone = Asia/Jakarta

Save and exit.

Now restart the httpd service.

systemctl restart httpd

The PHP 7 set up and configuration for Zabbix has been accomplished.

Step 3 – Set up and Configure MariaDB

Zabbix presents help for a lot of databases for the set up, together with MySQL, PostgreSQL, SQLite, and Oracle database. For this information, we might be utilizing MariaDB because the database for our Zabbix set up.

Set up mariadb-server utilizing yum command beneath.

sudo yum -y set up mariadb-server

After the set up is full, begin the service and allow it to launch everytime at system boot.

systemctl begin mariadb
systemctl allow mariadb

Now run the command beneath to configure MariaDB root password.

mysql_secure_installation

Sort your root password and press Enter.

Install MariaDB

MariaDB database has been put in, and the foundation password has been configured.

Subsequent, we have to create a brand new database for our Zabbix set up. We’ll create a brand new database and consumer named ‘zabbix‘ with password ‘[email protected]‘.

Login to the MySQL shell.

mysql -u root -p

And run the next MySQL queries on the shell.

create database zabbix;
grant all privileges on zabbix.* to [email protected]’localhost’ recognized by ‘[email protected]’;
grant all privileges on zabbix.* to [email protected]’%’ recognized by ‘[email protected]’;
flush privileges;

New database for Zabbix set up has been created.

Create database

Step 4 – Set up and Configure Zabbix 3.4

On this step, we are going to set up and configure Zabbix. We’ll set up Zabbix from the official repository, then configure Zabbix-server and Zabbix-agent.

– Set up Zabbix Packages

Add the Zabbix repository to the CentOS 7 system.

yum -y set up http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm

Now set up Zabbix utilizing the yum command beneath.

yum -y set up zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-agent

Await the Zabbix packages set up.

Install Zabbix

– Import Database Pattern

Import the Zabbix database pattern to our ‘zabbix’ database. Go to the Zabbix documentation listing and extract the Zabbix sql file.

cd /usr/share/doc/zabbix-server-mysql-3.4.6/
gunzip create.sql.gz

Now import the database pattern to our ‘zabbix’ database.

mysql -u root -p zabbix < create.sql

Sort your root password and ensure there isn’t any error.

Import the database

– Configure Zabbix Server

Zabbix-server is the central technique of the Zabbix software program system. We’ll configure the Zabbix-server by modifying the configuration file utilizing the vim editor.

Run the next command.

vim /and many others/zabbix/zabbix_server.conf

On the database line configuration, sort the configuration as beneath and alter the ‘DBPassword’ worth with your individual database password.

DBHost=localhost
[email protected]

Save and exit.

Now begin the Zabbix-server service and allow it to launch everytime at system boot.

systemctl begin zabbix-server
systemctl allow zabbix-server

Zabbix-server is operating on the CentOS 7 system – examine it utilizing the command beneath.

systemctl standing zabbix-server

And you’re going to get the consequence as proven beneath.

Configure zabbix server

– Configure Zabbix Agent

Zabbix-agent have to be put in on the goal monitoring system. The agent will collect all data of the server and stories information to the Zabbix-server.

Edit the Zabbix-agent configuration file utilizing vim.

vim /and many others/zabbix/zabbix_agentd.conf

Change following traces with your individual information:

 Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=hakase-labs

Save and exit.

Now begin the zabbix-agent and allow it to launch everytime at system boot.

systemctl begin zabbix-agent
systemctl allow zabbix-agent

Zabbix-agent is operating on the system – examine it utilizing the next command.

systemctl standing zabbix-agent

And you’re going to get the consequence as proven beneath.

Configure zabbix agent

Step 5 –  Configure Firewalld

On this step, we are going to open the HTTP and https port for Zabbix admin net UI, and also will add an extra port for Zabbix-server and Zabbix-agent.

Should you would not have firewalld in your system, set up it utilizing the next command.

yum -y set up firewalld

Begin the firewalld service and allow it to launch everytime at system boot.

systemctl begin firewalld
systemctl allow firewalld

Now we are going to open the HTTP and https port, and the port that might be utilized by the Zabbix-server and Zabbix agent (port 10051 and 10050).

Run the next firewall-cmd instructions.

firewall-cmd –add-service={http,https} –permanent
firewall-cmd –add-port={10051/tcp,10050/tcp} –permanent

Now reload the firewalld configuration and examine the port.

firewall-cmd –reload
firewall-cmd –list-all

Configure the firewall

Firewalld configuration for Zabbix set up has been accomplished.

Step 6 – Zabbix Preliminary Setup

Earlier than going any additional, we are going to restart all of our providers utilizing the systemctl instructions beneath.

systemctl restart zabbix-server
systemctl restart zabbix-agent
systemctl restart httpd

Now open your net browser, and sort your server IP tackle.

http://192.168.33.10/zabbix/

And you can be redirected to the Zabbix welcome message.

Zabbix setup

Click on the ‘Subsequent Step‘ button.

Now, Zabbix will examine all system necessities for its set up. Be sure that there isn’t any error.

Check pre-requisites

Then click on the ‘Subsequent step‘ button once more.

For the database information, sort all of your database setup.

Configure db

And click on the ‘Subsequent step‘ button.

Now comes the Zabbix server particulars configuration. On the ‘Host’ discipline, sort your individual server IP tackle, and alter the title with your individual area title or hostname.

Server details

Click on the ‘Subsequent step‘ button once more.

Be sure that all of these configurations are appropriate, then click on the following button to put in Zabbix.

Installation summary

And when the set up is full, you’re going to get the web page as proven beneath.

Zabbix successfully installed

Click on the ‘End‘ button and you can be redirected to the Zabbix login web page.

Login with default consumer ‘admin‘ and password ‘zabbix‘.

Login to zabbix

Now you get the Zabbix admin Dashboard.

Zabbix dashboard

Zabbix server set up has been accomplished.

Step 7 – Change Default Admin Password

On this step, we need to change the default Zabbix admin password for safety.

On the Zabbix admin dashboard, click on the consumer icon on the highest proper.

Change Default Admin Password

Click on the ‘Change Password’ button and sort your new password.

Change password

Now click on the ‘replace’ button, and the default admin password has been modified.

Zabbix monitoring system is now put in on the CentOS 7 server.

10 Instagram Accounts For UI & UX Design Inspiration

Previous article

Webinar Collection: Deploying Stateful Companies in Kubernetes

Next article

You may also like

Comments

Leave a Reply

More in Apache