Share on Social Media

Learn about Zabbix installation on Ubuntu 20.04 Server with this detailed step-by-step guide. Ensure smooth installation and configuration of this powerful server monitoring tool for your infrastructure. #centlinux #linux #zabbix

What is Server Monitoring Software?

Server monitoring software is a type of tool or application designed to monitor the performance, health, and availability of servers and IT infrastructure components. These software solutions continuously collect data from servers, network devices, databases, applications, and other system resources to provide insights into their operation and performance. Key features and functionalities of server monitoring software include:

  1. Real-time Monitoring: Constantly monitors server performance metrics such as CPU usage, memory usage, disk space, network traffic, and system uptime in real-time.
  2. Alerting and Notification: Alerts administrators or IT staff about any potential issues or anomalies detected on servers through email, SMS, or other communication channels.
  3. Historical Data Analysis: Collects and stores historical performance data, allowing administrators to analyze trends, identify patterns, and forecast future resource needs.
  4. Dashboards and Reporting: Provides intuitive dashboards and customizable reports to visualize server performance metrics and monitor the overall health of the IT infrastructure.
  5. Resource Utilization Tracking: Tracks resource utilization trends over time to optimize server resource allocation, capacity planning, and infrastructure scaling.
  6. Configuration Management: Manages server configurations and ensures compliance with predefined standards and policies to maintain security and stability.
  7. Automated Remediation: Offers automated remediation actions to address common server issues and minimize downtime, such as restarting services or reallocating resources.
  8. Integration with ITSM Tools: Integrates with IT service management (ITSM) tools and ticketing systems to streamline incident management and resolution processes.
  9. Scalability and Flexibility: Scales to support large, distributed server environments and adapts to different types of servers, operating systems, and network architectures.
  10. Security and Compliance: Ensures data security and compliance with regulatory requirements by monitoring server access, user activities, and security configurations.

Server monitoring software plays a crucial role in maintaining the reliability, performance, and security of IT infrastructure, enabling organizations to proactively identify and resolve issues before they impact business operations.

What is Zabbix Server?

Zabbix Server is a powerful open-source server monitoring solution designed to monitor the performance, health, and availability of IT infrastructure components in real-time. It serves as the central component of the Zabbix monitoring platform, coordinating the collection, processing, and analysis of monitoring data from various sources. Key features and functionalities of Zabbix Server include:

  1. Data Collection: Collects monitoring data from servers, network devices, virtual machines, databases, applications, and other IT resources using various monitoring methods such as SNMP, ICMP, JMX, and agent-based checks.
  2. Flexible Monitoring: Supports a wide range of monitoring scenarios, including server performance metrics (CPU, memory, disk, network), application monitoring, log file monitoring, and custom data collection.
  3. Alerting and Notification: Generates alerts and notifications based on predefined triggers and thresholds, alerting administrators or IT staff about potential issues or anomalies via email, SMS, or other communication channels.
  4. Real-time Monitoring: Provides real-time monitoring of IT infrastructure components, allowing administrators to quickly identify and respond to performance issues and outages.
  5. Dashboards and Reporting: Offers customizable dashboards and reports to visualize monitoring data, track performance trends, and analyze historical data for capacity planning and optimization.
  6. Scalability: Scales to support large-scale, distributed IT environments with thousands of monitored devices and millions of metrics, ensuring flexibility and reliability as infrastructure grows.
  7. Automation and Remediation: Supports automated actions and remediation workflows to address common issues and perform routine maintenance tasks, reducing manual intervention and downtime.
  8. Integration: Integrates with other IT management tools, services, and platforms through APIs and plugins, facilitating seamless integration into existing IT ecosystems and workflows.
  9. Security: Ensures data security and integrity by implementing robust authentication, encryption, and access control mechanisms, protecting monitoring data from unauthorized access and tampering.
  10. Open Source: Being open-source software, Zabbix Server offers flexibility, transparency, and cost-effectiveness, allowing organizations to leverage its capabilities without licensing fees or vendor lock-in.

Zabbix Server plays a critical role in maintaining the reliability, performance, and security of IT infrastructure, providing organizations with the visibility and control needed to ensure business continuity and operational efficiency.

Recommended Books: Zabbix 5 IT Infrastructure Monitoring Cookbook (PAID LINK) by Nathan Liefting
Recommended Online Training: Zabbix Application and Network Monitoring

2360122 39a6 7show?id=oLRJ54lcVEg&offerid=1074652.2360122&bids=1074652

Environment Specification

We are using a minimal Ubuntu 20.04 LTS virtual machine with following specifications.

  • CPU – 3.4 Ghz (2 cores)
  • Memory – 4 GB
  • Storage – 40 GB
  • Operating System – Ubuntu Server 20.04 LTS
  • Hostname – zabbix-01.centlinux.com
  • IP Address – 192.168.116.239 /24

Update Ubuntu 20.04 Software Packages

Connect with zabbix-01.centlinux.com as a privileged user by using a ssh client.

Execute apt command to update list of available packages.

$ sudo apt update

In our Ubuntu server, there are 65 packages that can be upgraded. The output may vary on your Ubuntu operating system.

Execute following command at Linux bash prompt to upgrade the listed software packages.

$ sudo apt -y upgrade

Install Zabbix APT Repository

Zabbix website provides installation package for various Linux distros. You can install this package to add it’s official repository in Package Management System of your Ubuntu operating system.

Download software package for Zabbix 5.0 repository from their official website.

$ wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb

Use dpkg command to install download package.

$ sudo dpkg -i zabbix-release_5.0-1+focal_all.deb

Update list of available software packages for your Ubuntu operating system by using apt command.

$ sudo apt update

Start Zabbix Installation on Ubuntu 20.04

You have successfully added Zabbix official repository in your Linux operating system. Therefore, you can now easily install Zabbix on Ubuntu this software by using apt command.

$ sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent

Install MySQL on Ubuntu 20.04

In this guide, we are using Apache web server and MySQL database server with Zabbix application. Therefore, you are required to have a MySQL database server.

If you do not have a MySQL database server in your network, then you have to install it on zabbix-01.centlinux.com machine.

$ sudo apt install -y mysql-server

After succesfull installation, check the status of MySQL service.

$ sudo systemctl status mysql

MySQL database service is already started.

Configure MySQL database server by using mysql_secure_installation command.

$ sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: Y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : Y
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
Success.


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
Success.

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
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

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
Success.

All done!

Create Database for Zabbix Server

Connect to MySQL database server by using mysql command.

$ sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 15
Server version: 8.0.23-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

Create ‘zabbix’ database to be used by your monitoring server.

mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected, 2 warnings (0.01 sec)

Create a database user ‘zabbix’ and set a strong password.

mysql> create user zabbix@localhost identified by 'P@ssw0rd';
Query OK, 0 rows affected (0.01 sec)

Grant all privileged on zabbix database to zabbix user.

mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Zabbix server documentation provides a SQL script to create it’s repository in MySQL database.

You can run this SQL script as follows.

$ zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbix -p zabbix
Enter password:

Edit Zabbix server configuration file in nano text editor.

$ sudo nano /etc/zabbix/zabbix_server.conf

And set the zabbix database user’s password in this file.

DBPassword=P@ssw0rd

Edit Apache configuration file in nano text editor.

$ sudo nano /etc/zabbix/apache.conf

Uncomment and set your respective Time Zone. There are multiple occurrences of this directive, you should set each of them.

php_value date.timezone America/Santiago

Restart and Enable Zabbix Server, Agent and Apache services.

$ sudo systemctl restart zabbix-server zabbix-agent apache2
$ sudo systemctl enable zabbix-server zabbix-agent apache2
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server
Synchronizing state of zabbix-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-agent
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /lib/systemd/system/zabbix-server.service.

Allow Apache service in Ubuntu Firewall by executing ufw command.

$ sudo ufw allow apache
Rules updated
Rules updated (v6)

Web Setup of Server Monitoring Tool

Open URL http://zabbix-01.centlinux.com/zabbix/ in a web browser.

Zabbix Server - Welcome Page
Zabbix Server – Welcome Page

If you have performed the installation as described above, then you will see this welcome page of Zabbix web setup.

Click on ‘Next Step’.

Zabbix Server - Prerequisites Checks
Zabbix Server – Prerequisites Checks

If you have performed the configurations correctly, then you will get the ‘OK’ status for all the Zabbix perquisites.

Move on to ‘Next Step’.

Zabbix Installation - Configure DB Connection
Zabbix Installation – Configure DB Connection

Provide the connection details of your MySQL server, including database and user credentials.

Click on ‘Next Step’.

Zabbix Server Details
Zabbix Server Details

Enter the hostname/IP address and port number of the Linux server. You are required to provide the name of the installation (optional).

Continue to ‘Next Step’.

Zabbix Pre-installation Summary
Zabbix Pre-installation Summary

Web setup will display the configurations, that you have made so far.

Click on ‘Next Step’ if you are happy with them, otherwise go back and adjust them as per your requirement.

Zabbix Installation is Completed
Zabbix Installation is Completed

Configuration file has been created and the installation of Zabbix frontend completed successfully.

Zabbix Login
Zabbix Login

Login as default Zabbix user/password i.e. admin/zabbix.

Zabbix Dashboard
Zabbix Dashboard

After successful login, you will reach at the Zabbix dashboard.

Read Also: Create Local APT Repository in Ubuntu 20.04

Final Thoughts

If you found this guide of Zabbix installation on Ubuntu 20.04 Server helpful and need further assistance, consider hiring a professional. I offer comprehensive installation, configuration, and troubleshooting services for Zabbix and other server monitoring solutions.

Check out my Fiverr profile for more details and to book a service: Seasoned Linux Administrator

Let’s ensure your server monitoring system is up and running smoothly!

5 thoughts on “Zabbix Installation on Ubuntu 20.04 Server”
  1. no work:

    zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix -p zabbixdb
    Enter password: gzip: /usr/share/doc/zabbix-server-mysql*/create.sql.gz: No such file or directory

Leave a Reply

Your email address will not be published. Required fields are marked *