Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Install Zabbix on Ubuntu 18.04

In this post we will learn how to Install Zabbix on Ubuntu 18.04. Zabbix is an enterprise monitoring solution that monitors network and server assets.

Prerequisites

Before we install Zabbix on Ubuntu 18.04, let’s prepare a server.

First, we need to start with a fresh install of Ubuntu 18.04.

Perform all the updates and reboot to start using any new kernel updates.

apt update && apt upgrade -y
reboot

Next, we need to enable the universe repositories.

Open /etc/apt/sources.list and put universe at the end of each line like this:

deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

Save and exit.

Update the repositories.

apt update

We can now start installing Zabbix.

Install Zabbix

Run these commands to install the Zabbix repository.

wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb
dpkg -i zabbix-release_3.4-1+bionic_all.deb
apt update

Next, install Zabbix.

apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent

Setup the Database

First, configure the MySQL server.

mysql_secure_installation

This script will ask you several questions.

First, the script will ask you for the current Root user Password.

It is not set yet so hit enter.

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):

Next Hit Y to create a new password.

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y

Next, the script will ask you to set a new password for the root MySQL user.

New password:

Re-enter new password:

The script will now ask you to remove anonymous users.  Answer yes.

By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y

Next, it will ask you if you want to disallow root login remotely.  We should always answer yes to this.

Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : Y

It will ask you to remove the test database and access to it.  Answer yes.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y

Next, it will ask you to reload the privilege tables.  Answer yes.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y

Finally, the script completes.

Create the Database

Run the MySQL CLI command:

mysql -u root -p

Create the database:

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

Create the user.

MariaDB [(none)]> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'password';

Make sure to use a more secure password.

Finally, exit.

MariaDB [(none)]> exit;
Bye

Import the Schema

Now we need to import the database schema.

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Enter the password that we just created for the zabbix user.

Zabbix Configuration Files

Next, we need to update the Zabbix configuration to use the password we set for the zabbix user.

Open /etc/zabbix/zabbix_server.conf and update this line with the correct password.

DBPassword=password

Save and exit.

Next open /etc/zabbix/apache.conf and uncomment this line in the mod_php7.c section:

# php_value date.timezone Europe/Riga

Change the time zone to match your current timezone.

Here is a list of time zones for PHP.

Save and close the file.

Start the Server

Run the following commands to start and enable the server on boot.

systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2

Finish the Installation

Now we can login to your Zabbix server and finish the installation.

http://{your_server}/zabbix

You will see the Welcome Screen.

Click the Next step button.

This screen checks to make sure that everything is OK.  Click the Next step button to continue.

The next screen is where we need to configure the database connection information.

All you should have to update here is the Password.  Click on the Next step button to continue.

In the next screen, we enter the Zabbix server details.

Enter the FQDN of the server if you have local DNS or the IP address in the Host field.

Leave the port at the default.

In the name enter zabbix.

Next, click on the Next step button to continue.

The next screen sums up all the installation details.

Verify that everything is correct.

Click on the Next step button to continue.

You will now see that Zabbix is installed.

Click the Finish button.

You can now login with the default username of Admin and password of zabbix.

You should now see the Zabbix Dashboard.

We now have Zabbix installed.

Conclusion

Your server still needs some configuration to monitor other servers and services.

In the next post we will walk though configuring Zabbix for monitoring other servers.

I hope you enjoyed this post.

If you did then please share it and comment below.

The post Install Zabbix on Ubuntu 18.04 appeared first on AdminTome Blog.



This post first appeared on AdminTome, please read the originial post: here

Share the post

Install Zabbix on Ubuntu 18.04

×

Subscribe to Admintome

Get updates delivered right to your inbox!

Thank you for your subscription

×