news
Serverspace has added a new Rocky Linux OS
WT
January 16, 2023
Updated June 7, 2023

Installing Zabbix on Ubuntu

Monitoring NGINX Ubuntu Zabbix

Using another OS?

Select the desired version or distribution.

Installing Zabbix on Ubuntu

Zabbix is a popular open-source system for monitoring IT infrastructures. It can monitor a variety of parameters, such as CPU usage, disk space, ping, host availability, network load, certain app status, run in net discovery mode, or even external thermal or pressure sensors if you need something like this, as well as create graphs and send alerts with e-mail or any service compatible for integration.
Zabbix monitoring can work with an agent program as well as with existing system or device resources (e.g., ICMP ping or SNMP, including connecting via SSH or Telnet, executing commands, and using the output as return value)
For this example let's launch Zabbix server on an Ubuntu 20.04.

Preparations

Prerequisites: ubuntu 20.04 machine with con

figured network, root acces
Default repositories have Zabbix on their list, but not the newest version. Fortunately, Zabbix maintains its own official repository.
Use root access for convenience, as most of our commands will need it, or add sudo before them, changing files in the/etc folder will also require this.

wget dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb
dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb

apps necessary: server itself, database, php engine and sql scripts.

apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts

Configuring Mysql

Server requires a database to work with, so let's start one.

apt install mysql-server
systemctl start mysql.service

Zu(1)

Login as root, otherwise it won't let us do all the things required.

mysql -uroot -p

When we first log in, we'll be asked to come up with a password.
Make the base, and a user to use it (leave the quotes if you change password)

create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'password';
grant zabbix@localhost all privileges on zabbix.*;

That variable let's you insert a template database.

set global log_bin_trust_function_creators = 1;
exit;

Zu(1)

Get template configuration: zcat gives us the content of gzip file by the url, and '|' (pipe), takes the result of previous comand as an input for the next one, effectivly putting file's contents in database as a command.

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -u zabbix -p zabbix

Log back into Mysql and Disable binary logging by changing it back to zero.
Remove comment ("#" sign) from the "DBPassword=" and add user password from earlier in/etc/zabbix/zabbix_server.conf
Zu(2)

PHP server

Open /etc/zabbix/nginx.conf. Enable "listen' and 'server_name' same way as a previous one. "listen 8080" defines the port where our web interface will be available, don't touch it unless you have something else running on php, and in "server_name" put server's address instead of "example.com".

Zu(5)

Let's check available locales with.

locale -a

Zu(7)

if en_US.utf8 is here - then everything's fine.
If not - edit /etc/locale.gen file, uncomment en_US.utf8 line, or any language you need and then run.

locale-gen

And check again.
Almost ready, let's get server going and launch on startup.

systemctl restart zabbix-server php7.4-fpm
systemctl enable zabbix-server php7.4-fpm

Go to http://server_ip:8080 and have a look at our future monitoring system.
All is fine.

Zu (6)

Let us go ahead and check if everything's working.

Zu(10)

In DataBase type - choose Mysql, type zabbix as base and username, password same as earlier.

Zu(11)

Any name you like.

Zu(12)

Once again, check if everything is ok.

Zu(13)

Zu(15)

Server is ready. Go further and enter credentials.
Admin zabbix
Enter your own afterwards at Administration > users > Admin > change password

Conclusion

Today we have taken the first step towards setting up a monitoring system by deploying Zabbix server on Ubuntu 20.04.

Vote:
4 out of 5
Аverage rating : 4
Rated by: 4
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.