Zabbix is a widely used monitoring solution in Linux, Windows, Unix, and Network appliances environments. It can pull a number of network parameters such as uptime, general performance, and security related metrics. Zabbix is so mature and stable that it’s used in big organizations with thousands of network devices, servers, and deployed applications. The Zabbix software is released under the GNU General Public License, making it free to use, modify and distribute.

Here are some benefits of Zabbix server as your monitoring solution:

  • Zabbix is highly customizable: You can easily extend Zabbix functionality by writing custom scripts and integrations.
  • It’s an Open-Source solution: Zabbix is an attractive option if cost is a factor in your organization. You can deploy and tune to suit your use cases for free.
  • Zabbix is highly scalable: Zabbix architecture is designed for large-scale installations with thousands of devices to be monitored. Deployment of Proxy servers takes its scalability to the next level.
  • Active Development and Community: Zabbix has a huge community devoted to making it a good monitoring solution. There are tons of documentations, forums, tutorials, videos and support available when you need it.
  • Clustering support: You can deploy Zabbix in a high available setup through clustering to ensure no service interruptions whatsoever.
  • Notification and Alerts: Zabbix has an alerting system where you can define custom triggers and actions to be taken. Notifications can be sent via SMS, email, or other third-party integrations.
  • Among many other features

Install Zabbix Server on Ubuntu 24.04 (Noble Numbat)

We will setup the following dependencies that enables us to run Zabbix Server on Ubuntu 24.04.

  • Apache web serber
  • PHP and required extensions
  • MariaDB database server

Reference article: LAMP Stack installation on Ubuntu 24.04

1: Ensure system is updated

Login to your Ubuntu system and ensure all packages are updated.

sudo apt update && sudo apt -y upgrade

Reboot if kernel updates were applied to the system.

[ -f /var/run/reboot-required ] && sudo reboot -f

2: Install PHP, Apache, and MariaDB

Install PHP and all modules of PHP required to run Zabbix monitoring server on Ubuntu.

sudo apt install php php-{snmp,cgi,mbstring,common,net-socket,gd,xml-util,mysql,bcmath,imap}

Install Apache web server that will serve Zabbix web pages.

sudo apt install apache2 libapache2-mod-php

Our database of choice in this article is MariaDB. Let’s install it.

sudo apt install mariadb-server

Validate installation by checking software versions installed.

$ php --version
PHP 8.3.6 (cli) (built: Apr 15 2024 19:21:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.6, Copyright (c), by Zend Technologies

$ mariadb -V
mariadb  Ver 15.1 Distrib 10.11.7-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper

$ apache2 -version
Server version: Apache/2.4.58 (Ubuntu)
Server built:   2024-04-18T15:13:41

3: Add Zabbix APT repository

Zabbix provides repository for Debian and Red Hat based Linux systems. Since Ubuntu is Debian based Linux system we’re downloading .deb package file:

sudo apt install wget -y
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb

Install downloaded repository file:

sudo dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb

4: Install and Configure Zabbix Server

Update repository packages list.

sudo apt update

We’ve configured repositories and ready to install Zabbix server packages. Run the commands below to do so.

sudo apt install vim zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

Enable PHP CGI by executing the following commands in your terminal.

sudo  a2enconf php8.*-cgi

Set correct timezone in your PHP configuration file.

$ sudo vim /etc/php/*/apache2/php.ini 
; http://php.net/date.timezone
date.timezone = "Africa/Nairobi"

Reload apache for the changes to be applied.

sudo systemctl restart apache2

Confirm the status of your web service.

$ systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-05-05 16:27:59 UTC; 21s ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 18965 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 18968 (apache2)
      Tasks: 6 (limit: 2255)
     Memory: 13.8M (peak: 14.0M)
        CPU: 97ms
     CGroup: /system.slice/apache2.service
             ├─18968 /usr/sbin/apache2 -k start
             ├─18970 /usr/sbin/apache2 -k start
             ├─18971 /usr/sbin/apache2 -k start
             ├─18972 /usr/sbin/apache2 -k start
             ├─18973 /usr/sbin/apache2 -k start
             └─18974 /usr/sbin/apache2 -k start

May 05 16:27:59 noble systemd[1]: Starting apache2.service - The Apache HTTP Server...
May 05 16:27:59 noble systemd[1]: Started apache2.service - The Apache HTTP Server.

Login to MariaDB shell as root user.

sudo mysql -u root

Create a database and user for Zabbix:

CREATE DATABASE zabbix character set utf8 collate utf8_bin;;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@'localhost' IDENTIFIED BY 'ZabbixDBPassw0rd';
FLUSH PRIVILEGES; 
QUIT 

Next import data into the database created.

sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p'ZabbixDBPassw0rd' zabbix

Edit your Zabbix server configuration and set database credentials:

$ sudo vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=ZabbixDBPassw0rd

Restart Zabbix server services using systemctl command.

sudo systemctl restart zabbix-server zabbix-agent

Don’t forget to enable services starting automatically on system boot.

sudo systemctl enable apache2 zabbix-server zabbix-agent

Services status can checked with the commands below.

systemctl status zabbix-server zabbix-agent

5: Configure Zabbix Server from Web UI

Open your browser and access Zabbix web interface using the URL http://SeverIP/zabbix/ or http://hostname/zabbix/

install zabbix 7 01

Click “Next step” and confirm all the dependencies are met. It should return “OK“.

zabbix ubuntu 24.04

Set your database details as configured earlier.

Install and Configure Zabbix 6.0 LTS on Ubuntu 20.0418.04 2

Give your Zabbix server a name, this can be the hostname. Also choose the default theme and set timezone correctly.

Install and Configure Zabbix 6.0 LTS on Ubuntu 20.0418.04 3

 Confirm all configurations are set correctly then proceed to finalize the process.

Install and Configure Zabbix 6.0 LTS on Ubuntu 20.0418.04 4

A congratulations message is shown if everything went as expected. Finish the installation to login.

image

Use the following default credentials to access Zabbix admin dashboard.

Username: "Admin"
Password: "zabbix"

Here is a screenshot of how the dashboard should look like.

image 1

6: Set strong Admin user password.

Go to Administration > Users > Admin > Password > Change Password as below.

Install and Configure Zabbix 6.0 LTS on Ubuntu 20.0418.04 8

Set a strong password for the admin user to better secure your Zabbix installation against attacks.

7: Adding monitoring agents to Zabbix Server

To add a new target host to be monitored by Zabbix, go to Configuration > Hosts, you should see the local Zabbix Server status enabled as below.

image 2

Host graphs and dashboards can be viewed by going to Monitoring > Hosts. Other hosts can be added by giving it a name and IP address. But remember to configure Zabbix Agent on the end device.

Conclusion

In our tutorial we have showed you a step-by-step installation of Zabbix Server on Ubuntu 24.04. Zabbix is such a capable and scalable monitoring solution suitable for small businesses as well as big organizations. If you need a highly available setup, zabbix has clustering setup that you can explore. This is a single server installation that can be adopted for small infrastructure with fewer devices located in same DC.

LEAVE A REPLY

Please enter your comment!
Please enter your name here