Zabbix Installation On Server

Zabbix Logo

How to Install Zabbix for Server Infrastructure Monitoring?

As you go through the product development phase and run your operations and workflows, the need for constantly monitoring your server infrastructures is inevitable. You want to make sure of the smooth performance of the servers with efficient workflows, so that you may lead the path to the development of a stellar product.

As you sift through the solutions to meet these monitoring requirements, what you basically are looking for is an efficient and robust monitoring tool or software that could meet your business requirements every step of the way. Zabbix is one of the many tools that promises an effective solution.

Zabbix came into the picture in 1998, only to be publicly launched in 2001 as a network management system with robust capabilities and functionalities to monitor your workflows as well as the performance and status of your server infrastructures and other network services. The tool comes handy in to monitor standard services and other statistics such as CPU load, network utilization, disk space, etc., and you can get real-time notifications for all the tracking. This kind of real-time monitoring is extremely helpful in ceaselessly managing the workflows for their most efficient performance while taking care of any issues as soon as they arise.

So, now that you know the monitoring capabilities you can have with Zabbix, you shall quickly want to install it into your systems and leverage it to the maximum business advantage. But how do you go through with the installation?

Here in this article, we are going to talk on how to install and configure Zabbix in your systems. So, let’s get started!

How to Install and Configure Zabbix?


Zabbix basically has three major components, viz., Zabbix Server, Zabbix Agent, and Zabbix Web Interface. Out of these components, you need to install the Zabbix Server and Zabbix Agent into your system and you can skip the web interface part. The monitoring of your Zabbix Agents through the Zabbix Server will still be the same. However, using the web interface still enhances the monitoring experiences by a certain degree.

Installing Zabbix Server


The process for the installation of Zabbix server can differ with your operating systems. In this case, we are detailing the steps for the installation of Zabbix server on Ubuntu.

Step 1: Create a LAMP Environment

A LAMP environment is essential for the installation of Zabbix Server. So, if you already have one, that’s great! In case you don’t, then you can quickly create one. All you have to do is install Apache, MYSQL, and PHP.

You can carry out the installations using the following commands:

$ sudo apt-get update
$ sudo apt-get install apache2 libapache2-mod-php
$ sudo apt-get install mysql-server
$ sudo apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql

You shall also need to update the time zones in the php configuration files. Use the below command for that.

[Date]
; http://php.net/date.timezone
date.timezone = ‘Asia/Kolkata’

Step 2: Configure Zabbix Package Repository

Before you install Zabbix, it is good to have the Zabbix package repository configured and enabled in your system. Run the following commands to carry out the configuration. Check your operating system before running the commands and then choose the commands depending on the operating system version you are using.

## Ubuntu 18.04 LTS (Bionic):
$ wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb

## Ubuntu 16.04 LTS (Xenial):
$ wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+xenial_all.deb
$ sudo dpkg -i zabbix-release_4.0-3+xenial_all.deb

Step 3: Install Zabbix Server

Once you have enabled the repository, you simply have to run the following command for installing the Zabbix Server in your system.

$ sudo apt-get update
$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
As you shall run this command, Zabbix Server will get installed in your system along with MYSQL support.

Step 4: Create Database Schema

Once you have installed the Zabbix Server, you need to create a database schema and a user for your server. You can create this schema by logging in to your MySQL account and running the following queries.

$ mysql -u root -p
mysql> CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
mysql> CREATE USER ‘zabbix’@’localhost’ IDENTIFIED BY ‘password’;
mysql> GRANT ALL PRIVILEGES ON zabbixdb.* TO ‘zabbix’@’localhost’ WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;

After you have created the user, load the database schemas to the Zabbix server using the following commands:

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

Step 5: Edit Zabbix Configuration File

Now is the time you start with configuring Zabbix in your system and that starts with editing the configuration file. It goes as /etc/zabbix/zabbix_server.conf. Open this file in your text editor and then use the below settings for configuring the database.

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

The Zabbix Server uses these configurations to connect to the database.

Step 6: Restart Apache and Zabbix

You also have to configure Apache with Zabbix, and all you need to do for that is restart Apache. Zabbix creates its own configuration file for Apache along with a link in Apache configuration directory. Simply run the below command and restart Apache.
sudo service apache2 restart
Subsequently, restart Zabbix with the below command.
sudo service zabbix-server restart
This will start your Zabbix service and now all you have to do is go to the web installer wizard to finish up with the installation of Zabbix server.

Step 7: Finishing the Installation

Zabbix has a web installer wizard and you only need to complete this to finish the installation. You can access this installer on /zabbix subdirectory URL on your server’s IP or domain.

The wizard will open with a Zabbix Welcome Screen. Now all you have to do is look through the wizard, make sure everything is okay, fill up the forms in the wizard and keep clicking through the next button in the wizard until you reach the end.

In the end, you will see the finish button. As you click the Finish button, you shall see a login page. You can enter the login details and you will have your Zabbix dashboard appear on your screen.

You are hereby done with the installation of Zabbix Server in your system.

The next step for you is to install the Zabbix Agent.

Installing Zabbix Agent


Zabbix Agent is what will collect all the information from your servers for tracking. So, you need to install it on all your remote systems that you need to track with the Zabbix Server.

Step 1: Enable Apt Repository

Just like you had configured the repository during the installation of Zabbix Server, you need to go through as similar process for starting with the installation of Zabbix Agent. These repositories are available on the official website of Zabbix, and you need to run the following commands to add these repositories to your system for the installation of Zabbix agent.

For Ubuntu 18.04 (Bionic):

$ wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
For Ubuntu 16.04 (Xenial):

$ wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+xenial_all.deb
$ sudo dpkg -i zabbix-release_4.0-3+xenial_all.deb

Step 2: Install Zabbix Agent

Once the repositories are enabled and configured, simply run the below command for the installation of Zabbix agent in your systems.

$ sudo apt-get update
$ sudo apt-get install zabbix-agent

Step 3: Configure Zabbix Agent

The Zabbix Agent is installed in your system and now is the time to configure it. You basically have to edit the Zabbix Configuration file which goes by the name /etc/zabbix/zabbix_agentd.conf.

Additionally, you need to update the server IP for Zabbix as follows.

#Server=[zabbix server ip]
#Hostname=[Hostname of client system ]
Server=192.168.1.10
Hostname=Server2
This server IP will help to connect with the Zabbix client.

Step 4: Restart Zabbix

Once everything is configured, run the below commands to restart Zabbix.
$ sudo systemctl enable zabbix-agent
$ sudo systemctl start zabbix-agent
And you’re done! Zabbix Agent is installed in your system.
Once you have the Zabbix Server and Zabbix Agent installed in your system, all you have to do is add a host to your Zabbix Agent which you need to monitor.

Conclusion

Zabbix comes as an amazing tool for you to keep up with your systems, infrastructures, and workflows with constant and ceaseless monitoring. It’s an easy way to keep up with stellar performances while instantly fixing any issues arising any step of the way. And all you need to do for using this wonderful tool is run a few lines of commands and you are all set to achieve stellar workflow efficiencies that cater to better product development and subsequently scalable business performance that leads to growth and success.

Related post

LearnDash Platform

How to Grow Your LearnDash Platform with Membership Packages?

E-learning solutions are becoming very popular these days, not just in the educational industry but across multiple industry verticals. Organizations are increasingly using these solutions for the skill development of their employees as well as leveraging them to bring in more business and simultaneously growth and success by providing courses for the learners.

Read More »
LMS

7 Ways for Ensuring Your LMS Implementation to be a Success

E-learning solutions are not just any other trend in the marketplace today. With the need for better and more accessible learning and the importance of skill development for professional growth, e-learning industry has created its separate niche in this dynamic and ever-changing business environment.

Read More »
RPA and WLA

How to Integrate Workload Automation & RPA to Create Dynamic Synergies?

Automation is at its core in today’s dynamic, fast-growing, and ever-changing business world. As you talk about the discipline, you can come across topics and types of automation such as workload automation, IT process automation, business process automation, run book automation, batch processing, robotic process automation… and these are just to name a few.

Read More »