Categories
Linux Zabbix

Upgrade Zabbix Proxy from 6.0 to 6.2

I was recently going through the process of upgrading one of my Zabbix Proxy nodes following the upgrade documentation from Zabbix and needless to say there were issues. That is why I have decided to document how to Upgrade Zabbix Proxy from 6.0 to 6.2. This process will probably work for 6.0/6.2 to 6.4, but I have not tested it yet.

Let’s step through the process of upgrading and I will show you were the issue is. We will be performing this work on a Debian/Ubuntu based machine.

Upgrade Procedure

Before you begin, you will need to stop the Zabbix Proxy Service

Sudo service zabbix-proxy stop

Once the service has been stopped you will then want to make a backup, just encase things don’t go as planned

sudo mkdir /opt/zabbix-backup/
sudo cp /etc/zabbix/zabbix_proxy.conf /opt/zabbix-backup/
sudo cp -R /usr/share/zabbix-* /opt/zabbix-backup/

Once the backups are complete you will need to update your repository configuration package. You will start by uninstalling your current repository package.

sudo rm -Rf /etc/apt/sources.list.d/zabbix.list

This is where the guide goes off the rails. Even if you uninstall the current package repository, it does not remove it from the sources list. I somehow figured out that you need to run the following or this process will not work.

sudo dpkg --purge zabbix-release

Once you run this command you can proceed as normal. You will need to download the a new repository package and install it. Please note that you will need to make sure that you are using the correct OS and version number. I am using Debian 11 in the below example.

sudo wget https://repo.zabbix.com/zabbix/6.2/debian/pool/main/z/zabbix-release/zabbix-release_6.2-1+debian11_all.deb
sudo dpkg -i zabbix-release_6.2-1+debian11_all.deb

Once you have installed the package you will need to run a apt update to refresh your package list

sudo apt-get update

Here is another part of the Zabbix guide that I have had varing levels of success with. The guide wants you do to the following

sudo apt-get install --only-upgrade zabbix-proxy-mysql zabbix-frontend-php zabbix-agent

However sometimes it will not perform the upgrade if there are dependencies that need to be addressed so you should be able to just get away with

sudo apt-get upgrade

After the upgrade has been compeleted you need to restart the services or the proxy will not work until you reboot.

sudo service zabbix-proxy start

To verify that the the upgrade was successful you should run

sudo zabbix_proxy -V

If it shows the correct version of zabbix then you are good to go.

I hope you found this guide to be helpful and if so please share it with your friends. Also check out our other article on how to upgrade your Zabbix Server 6.0 to 6.2.

Categories
CentOS Linux Zabbix

Upgrade from Zabbix 6.0 to 6.2 on CentOS 8

Zabbix is an open source monitoring system that can monitor almost anything. You can learn more about Zabbix here. For the purpose of this article I will using the predeployed Zabbix Appliance from Linode. Linode is a cloud based hosting service that offers really good pricing for Linux based servers. Best of all they have a datacenter that is really close to my house. You can learn more about Linode and their services here. If you are a new sign up they run a deal sometimes to get a free $100 credit which you could use toward running your VM.

Prep work

The first piece of advice that I can give while you are working on the upgrade you should open a second ssh session to your server and run the following command:

 sudo tail -f /var/log/zabbix/zabbix_server.log

This will give you a better view of what is going on with the application once you start the service back up.

The next step is to stop the Zabbix Server Service

systemctl stop zabbix-server

From here Zabbix reommends backing up your configuration files.

This command will create a new backup folder

mkdir /opt/zabbix-backup/

These commands will copy your config files to your backup folder

cp /etc/zabbix/zabbix_server.conf /opt/zabbix-backup/
cp /etc/httpd/conf.d/zabbix.conf /opt/zabbix-backup/

This will copy your .php files to your backup folder

cp -R /usr/share/zabbix/ /opt/zabbix-backup/
cp -R /usr/share/zabbix-* /opt/zabbix-backup/

Starting the update

To proceed with the upgrade your current repository package has to be updated.

rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/8/x86_64/zabbix-release-6.2-1.el8.noarch.rpm

Switch the DNF module version for PHP:

dnf module switch-to php:7.4

To upgrade Zabbix components run the following command:

dnf upgrade zabbix-server-mysql zabbix-web-mysql zabbix-agent

Post upgrade work

Once the packages have been updated you will need to open your database. In my case I would type in mysql. Then according to the Zabbix documentation you need to run this command.

SET GLOBAL log_bin_trust_function_creators = 1;

One of the issues that I ran into, and I am not sure if this is just a Linode appliance issue or a CentOS issue but I had to run the following command. If I did not run this command the update would fail at 43% everytime.

grant all privileges on zabbix.* to 'zabbix_srv'@'localhost';

Once that is complete type quit and hen type thhe following command to start the Zabbix service.

systemctl start zabbix-server

Once you press enter the log file that you opened at the begin displaying output and you should see the entire startup processs and then update.

I hope you find this guide helpful and if so please share it with others.