UPDATING SERVER
In this installment I’ll be upgrading Zabbix to the latest release. The main reason is to get the latest dashboard widgets available.
Zabbix is an open-source monitoring solution designed to monitor the performance and availability of various IT infrastructure components. It can track network devices, servers, virtual machines, databases, applications, and cloud services. Zabbix provides detailed insights into these systems, helping administrators identify and troubleshoot issues quickly before they impact operations.
Hypervisor
Virtual Machine
Server :
OS :
CPU :
RAM :
Storage :
Dell PowerEdge R720
Proxmox 8.1.4
Intel Xeon E5-2680 v2 @ 2.80GHz
256GB
7TB
OS :
CPU :
RAM :
Storage :
Ubuntu 22.04
4 cores
8GB
80GB
Upgrading Zabbix involves updating the Zabbix server, proxy, agents, and frontend to a newer version to access new features, security patches, and performance improvements. The process typically includes backing up your configuration and database, updating the software packages, and verifying compatibility with existing components.
Key Steps:
- Backup: Always back up the database, configuration files, and custom scripts before upgrading.
- Upgrade Order: Upgrade components in this order: server → frontend → proxy → agents.
- Database Schema: Run database upgrade scripts if required for the new version.
- Testing: Test the upgraded environment in a staging setup before applying it to production.
Regularly upgrading Zabbix ensures optimal performance, access to new features, and compatibility with modern systems.
First I stopped Zabbix server to make sure that no new data is inserted into database.
systemctl stop zabbix-server
Then I created a back up directory.
mkdir -p /backup/zabbix
Then created a backup of the current Zabbix configuration files.
cp -R /etc/zabbix/ /backup/zabbix/
Then I backed up any custom alert scripts.
cp -R /usr/lib/zabbix/alertscripts/ /backup/zabbix/
Then backed up PHP files.
cp -R /usr/share/zabbix/ /opt/zabbix-backup/
And backed up Zabbix binaries.
cp -R /usr/share/zabbix-* /opt/zabbix-backup/
I then logged into MYSQL
sudo mysql -u root -p
Then I set the following to 1, so that when upgrading it will have the correct permissions.
set global log_bin_trust_function_creators = 1;
Exited.
EXIT;
Then backed up the Zabbix database.
mysqldump -u -p > /backup/zabbix/zabbix.sql
Then uninstalled the current Zabbix repository package.
rm -Rf /etc/apt/sources.list.d/zabbix.list
Then downloaded the latest Zabbix package.
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest+ubuntu22.04_all.deb
Then installed the Zabbix repository configuration package.
dpkg -i zabbix-release_latest+ubuntu22.04_all.deb
Then updated the repository information.
apt update
Upgrade the following Zabbix components,
sudo apt install --only-upgrade zabbix-server-mysql zabbix-frontend-php zabbix-agent
Then started the Zabbix server.
sudo systemctl start zabbix-server
I checked the log to see if there are any errors.
sudo tail -f /var/log/zabbix/zabbix_server.log
Once I saw this I knew the upgrade completed successfully.
Database upgrade completed.
Lastly, I restarted the rest of the services.
sudo systemctl restart zabbix-server zabbix-agent