Upgrading an Ubuntu Server on a Zabbix Server Proxy

Going from version 18.04 to 22.04

Rubenpinzon
Globant
5 min readDec 5, 2023

--

Photo by John Jacobsn on Unsplash

This article shows how to upgrade Ubuntu from version 18.04 to 22.04 on a Zabbix proxy server. Keeping the operating system updated we will obtain invaluable advantages such as security and stability; with each update, Ubuntu improves the compatibility between its applications and the operating system. Updating this operating system is a critical step in maintaining the optimal performance of your Zabbix proxy server and allowing you to adopt the latest innovations fully.

Zabbix is a powerful open-source monitoring tool that allows you to monitor networks, servers, and applications efficiently. At the center of the Zabbix architecture is the proxy server, an essential component that acts as an intermediary between the monitoring agents and the central server. With each new version of Zabbix, significant improvements in performance, security, and functionality are introduced.

Keeping your proxy server up to date is crucial to maximizing these improvements. This article will guide you through the Ubuntu operating system upgrade process, ensuring your Zabbix proxy server is ready to adopt the latest features and enhancements while keeping your operating system up-to-date and secure.

Step 1: Perform Backup

Before performing any major operating system upgrade, it is essential to completely back up all your important data and settings. This allows you to restore your system in case problems arise during the update process. Be sure to copy your Zabbix configuration files and any significant data you have from your proxy server. (If you have the Zabbix Proxy in a VM, fully back up your VM.)

Stop the Zabbix Proxy server and agent services to avoid conflicts during the upgrade:

sudo systemctl stop zabbix-proxy.service
sudo systemctl stop zabbix-agent.service
sudo systemctl stop postgresql

Step 2: Update Ubuntu 18.04

Before moving to the latest version, you must ensure your system is fully updated to the newest version available for Ubuntu 18.04. To achieve this, open a terminal and run the following commands:

sudo apt update && sudo apt upgrade -y
sudo reboot

It is a good practice to remove orphan dependencies, packages that are automatically installed and are no longer needed by any other package, including system-wide configuration files:

sudo apt autoremove --purge

To install the package update-manager-core update manager on Ubuntu:

sudo apt install update-manager-core

To update the packages installed in operating systems based on Debian and Ubuntu, its main feature is that you can install new packages or remove existing packages, if necessary:

sudo apt-get dist-upgrade -y

Step 3: Update Ubuntu to version 20.04

Ubuntu 20.04 is an LTS (Long-Term Support) release and is a necessary step to get to version 22.04. Run the following command to start the upgrade to Ubuntu 20.04:

sudo do-release-upgrade

This command will start the Ubuntu upgrade wizard. Follow the instructions on the screen to complete the update. During the process, you may be asked to confirm specific changes to the configuration files. Be sure to review the differences and choose the option that best suits your needs.

Once the upgrade to Ubuntu 20.04 is complete, reboot your system for the changes to take effect.

Step 4: Update Ubuntu to version 22.04

Once your system is on Ubuntu 20.04, you can upgrade to the latest version, Ubuntu 22.04. Rerun the following command:

sudo do-release-upgrade

Follow the instructions on the screen and confirm the necessary changes during the update process.

Step 5: Check System Update

The following command should show us on the screen the current version of the operating system, updated to version 22.04:

lsb_release -a

Step 6: Install the Zabbix 5.0 release package for Ubuntu 22.04

This command downloads and installs the Zabbix 5.0 release package for Ubuntu 22.04. Then, there should be a command wget to download the file. That of the Zabbix release package from the Zabbix repository:

wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-2+ubuntu22.04_all.deb

Then the command sudo dpkg -i installs the downloaded package on the system:

sudo dpkg -i zabbix-release_5.0-2+ubuntu22.04_all.deb
apt update

Now we need to add the Zabbix repository to the list of system package sources; this will allow you to install and update Zabbix packages using the usual package management commands like apt or apt-get:

wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-2+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_5.0-2+ubuntu22.04_all.deb
sudo apt-get update

Step 7:install dependencies

These commands simplify the process of installing multiple components on an Ubuntu system, including PostgreSQL, the postgresql-contrib package (which enhances PostgreSQL’s features), the Zabbix proxy for PostgreSQL, and the Zabbix agent.

Now, we need to install the postgresql-contrib package to expand the functionality of PostgreSQL. We also need to install zabbix-proxy-pgsql, a Zabbix proxy tailored for PostgreSQL and the Zabbix agent:

sudo apt install postgresql postgresql-contrib
sudo apt install zabbix-proxy-pgsql zabbix-agent -y

The Zabbix Proxy for PostgreSQL allows Zabbix to collect monitoring data using a PostgreSQL database as a buffer. The Zabbix agent is a program that runs on the monitored systems and collects data to send to the Zabbix server.

Step 8: Check the system

Before proceeding, it’s essential to verify the system configuration. One critical aspect to check is the configuration file for the Zabbix agent, located at:

/etc/zabbix/zabbix_agentd.conf

Within this file, there is a line that deserves attention:

AllowKey=system.run[*]

This particular line grants the capability to execute remote commands through the Zabbix agent:

sudo vi /etc/zabbix/zabbix_agentd.conf

Previously, remote command execution was enabled via the parameter: EnableRemoteCommands=1 but this parameter has been replaced by: AllowKey=system.run[*]

Step 9: Startup of Services and Activation

These commands are used to manage the Zabbix agent and proxy services on a system that utilizes systemd as its primary service management framework. By enabling and starting the service with the following commands, you ensure that the Zabbix agent and proxy services are correctly configured:

sudo systemctl enable zabbix-proxy
sudo systemctl start zabbix-proxy

These commands are related to managing the Zabbix agent service on a Linux system using the Systemd init system. Enabling the service, starting the service, and displaying the service status:

sudo systemctl enable zabbix-agent
sudo systemctl start zabbix-agent
sudo systemctl status zabbix-agent

Step 10: Check the system

After completing the upgrade to Ubuntu 22.04, restart your proxy server to ensure all changes are applied correctly, and then check that everything works as expected. Check the status of the proxy server and make sure that the Zabbix proxy server is running perfectly after the update:

zabbix_proxy -V
zabbix_agentd -V

Check the connectivity with the Zabbix server and make sure that the proxy server is correctly connected to the central Zabbix server and that it is sending monitoring data correctly:

sudo systemctl status zabbix-proxy
sudo systemctl status zabbix-agent

Lastly, check the logs of the proxy server and any other relevant services to make sure there are no critical errors after the update:

journalctl -xe

Conclusion

Upgrading Ubuntu from version 18.04 to version 22.04 on a Zabbix Server Proxy is a critical process to keep your operating system up to date with the latest performance and security improvements. Following the steps outlined in this article and making a full backup before you begin, you can update your Ubuntu safely and efficiently.

Always remember to check the official Ubuntu documentation for up-to-date information on the upgrade process and possible configuration changes. Good luck updating your Ubuntu Server in the Zabbix Server Proxy!

References

--

--