
This guide will walk you through the steps to install and configure Zabbix 4.4.4 on a CentOS 7 server. These instruction can also be applied if you are running an RHEL 7 server.
Prerequisites
You will need one CentOS/RHEL 7 (physical or virtual) machine with minimal installed having sudo non-root user privileges.
Disabling SELinux
You should change from SELINUX=enforcing to SELINUX=disabled in /etc/selinux/config file for smooth installation of the packages:
Save and close.Now reboot your CentOS/RHEL machine to take changes into effect:
Adding EPEL Repository
It is always recommended to add extra packages for enterprise Linux repository before installing packages on your CentOS or RHEL:Adding Zabbix Repository
Zabbix isn't available in yum package manager by default, so you will need to install Zabbix official repository on your CentOS or RHEL 7:Installing Apache
You can install the latest version of Apache by typing the following command:Installing MariaDB
MySQL is now replaced with MariaDB on CentOS 7, so you will need to install MariaDB database using the following command:Starting Services
Now start Apache and MariaDB service and make them persistent even when system reboots:Securing MariaDB
By default MariaDB database is not secure and anyone can intrude into your database, so make it secure by executing the following script and follow the instruction:Response to the following prompts on your CentOS server:
Installing Zabbix
Now you can install the Zabbix server and web frontend with its database using the following command:You will also need to install Zabbix agent to collect data about the Zabbix server itself:
Creating Database
At this stage you will need to create a user and a database for Zabbix like below:Type the following on mysql prompt:
Importing Zabbix Database Schema
Find out the Zabbix database schema file and then import it into your newly created database:Now import this schema file into database like below:
Database Credential Settings:
Now edit the /etc/zabbix/zabbix_server.conf file, uncomment by removing # and update the DBPassword= parameter with your zabbix database user password:Save and close.
Configuring PHP
The Zabbix installation process created an PHP configuration file that contains PHP settings. It is located in the directory /etc/httpd/conf.d/. You just need to uncomment date.timezone parameter and update it with your timezone. You can check supported time zones on http://php.net/manual/en/timezones.php to find the right one for you.
Now restart Apache service to take changes into effect.
Starting Zabbix Service
Its time to start Zabbix server and make it persistent even when system reboots:Check the Zabbix server status before proceeding to next step:
If the zabbix service is failed to start, reboot your CentOS 7 machine.
Once rebooted, check zabbix server status again
The Zabbix server status shows up and running, so lets proceed to next step.
Adding Firewall Rules
Configuring Zabbix
The Zabbix web interface lets us see reports and add network devices that you wish to monitor, but it needs some initial setup before we can use it. Open up your web browser and navigate to http://your_server_name_or_ip/zabbixClick Next step to continue.

This page will show you the table that lists all of the prerequisites to run Zabbix. If anything missing make sure to fix it first then proceed to Next.


Keep it default and proceed next.

This is the summary screen, verify and proceed next.

This screen confirms that you have successfully installed Zabbix.
Click Finish

Zabbix frontend is ready! The default user name is Admin, password zabbix.

Once logged in, you will see below dashboard screen and from here you can administer and manage your Zabbix server.

Installing Zabbix Agent
In this step we will show you how to install and configure Zabbix agent 4.4.4 on a CentOS, RHEL, Ubuntu and Windows machine.For CentOS/RHEL 7
Now edit /etc/zabbix/zabbix_agentd.conf file and update the Server= parameter with your zabbix server IPSave and close.
For CentOS/RHEL 8
Now edit /etc/zabbix/zabbix_agentd.conf file and update the Server= parameter with your zabbix server IPSave and close.
For Ubuntu 16
Now edit /etc/zabbix/zabbix_agentd.conf file and update the Server= parameter with your zabbix server IPSave and close.
For Ubuntu 18/19
Now edit /etc/zabbix/zabbix_agentd.conf file and update the Server= parameter with your zabbix server IPSave and close.
For Windows
Zabbix Windows agent can be installed from Windows MSI installer packages (32-bit or 64-bit) available for download:To install, double-click the downloaded MSI file.

Click Next

Accept the licence to proceed to the next step.

Specify the following parameters and click next.

Click next

Click install

Click finish

Zabbix components along with the configuration file is now installed in a Zabbix Agent folder in Program Files. zabbix_agentd.exe will be set up as Windows service with automatic startup.
Adding Devices to Zabbix Server
When you are done installing Zabbix agent on your Linux or Windows machines, go back to your Zabbix server web interface and start creating devices to monitor them.
Navigate to Configuration tab
Click Hosts then click Create host
This is our Windows 10 zabbix agent machine. Specify the following parameters according to yours and click Add
Click Templates and add the templates according to your need.
When done adding hosts, navigate back to Dashboard and there you can see number of hosts you have added in zabbix server to monitor.
Navigate to Graphs, select your host and graph from the drop down list and see if your host monitoring data is being collected like below.
This is how you can add and monitor your Windows and Linux machines in zabbix server. For the devices like switches, routers, firewall etc, of course you can not install zabbix agent, but you can add and monitor them in zabbix server via SNMP and IPMI interface.
Navigate to Configuration tab

Click Hosts then click Create host

This is our Windows 10 zabbix agent machine. Specify the following parameters according to yours and click Add

Click Templates and add the templates according to your need.

When done adding hosts, navigate back to Dashboard and there you can see number of hosts you have added in zabbix server to monitor.
Navigate to Graphs, select your host and graph from the drop down list and see if your host monitoring data is being collected like below.

This is how you can add and monitor your Windows and Linux machines in zabbix server. For the devices like switches, routers, firewall etc, of course you can not install zabbix agent, but you can add and monitor them in zabbix server via SNMP and IPMI interface.
Wrapping up
In this tutorial, you set up a simple and secure solution which will help you monitor your servers. It can now warn you of problems, and you have the opportunity to plot some graphs based on the obtained data so you can analyze it and plan accordingly.
No comments: