In this tutorial we’ll learn how to install Zabbix Monitoring on Ubuntu 16.04. We will also install and configure its prerequisites. Zabbix is a free and open source network monitoring Software tool which is used to monitor and track the availability and performance of your IT infrastracture such as WEB monitoring, auto-discovery, and more.
I recommend to use a minimal Ubuntu server setup as a basis for the tutorial, that can be a virtual or a root server image with an Ubuntu 16.04 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Zabbix Monitoring on Ubuntu 16.04
Step 1. First, ensure your system and apt package lists are fully up-to-date by running the following:
apt-get update -y apt-get upgrade -y
Step 2. Installing LAMP on Ubuntu 16.04.
You should check out this LAMP stack install tutorial for Ubuntu 16.04, if you haven’t installed LAMP yet. Once it’s installed, come back here and read on. We also will install the required packages for LAMP stack and the important PHP extension that Zabbix relies on:
apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-gd php7.0-mbstring php7.0-zip php7.0-dom php7.0-xml
Step 3. Installing Zabbix.
First, add Zabbix Server Repositories to Ubuntu 16.04:
wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb dpkg -i zabbix-release_3.4-1+xenial_all.deb
Now use the below command to install Zabbix and necessary packages:
apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Step 4. Configure Zabbix Server with MariaDB.
Next, we need to create a database for the Zabbix installation:
mysql -uroot -p
Run the following command to create a database for Zabbix:
CREATE DATABASE zabbixdb; GRANT ALL on zabbixdb.* to zabbix@localhost IDENTIFIED BY ‘yourpassword’; FLUSH PRIVILEGES; exit;
Import zabbix database schema in newly created database:
cd /usr/share/doc/zabbix-server-mysql zcat create.sql.gz | mysql -u root -p zabbixdb
Now we need to edit database configuration in in zabbix_server.conf file:
Update the following:
DBHost=localhost DBName=zabbixdb DBUser=zabbix DBPassword=yourpassword
After importing the zabbix database we need to enable and start zabbix-server service:
systemctl enable zabbix-server systemctl start zabbix-server
Step 5. Edit PHP timezone.
Open the file /etc/zabbix/apache.conf created by Zabbix with your favourite editor:
Update the following:
php_value date.timezone Asia/Kolkat
Save the file and don’t forget to reload the apache2 service using the below command:
systemctl reload apache2
Step 6. Accessing Zabbix Monitoring Web Installation.
Now you can access the Zabbix web install wizard in your browser by entering the domain-name/zabbix or http://your_ip/zabbix/ to continue your Zabbix installation. I suggest you read up on Zabbix documentation and specifically the concepts and definitions.
Congratulation’s! You have successfully install and configured Zabbix Monitoring on your Ubuntu 16.04 server. Thanks for using this tutorial for installing Zabbix on Ubuntu 16.04 LTS (Xenial Xerus) system.