Posts

Showing posts from November, 2025

Zabbix package : Linux commands

For APT-based systems (Ubuntu / Debian) 1. List all available Zabbix packages in the repo apt list | grep zabbix or to include all versions : apt list -a | grep zabbix 2. List all installed Zabbix packages dpkg -l | grep zabbix For YUM/DNF-based systems (RHEL / CentOS / Rocky / Alma) 1. List all available Zabbix packages in the repository yum list available | grep zabbix 2. List all installed Zabbix packages yum list installed | grep zabbix

Zabbix DB backup and restoration

 Step 1: Take Backup (Dump) # Go to backup directory mkdir -p /var/backups/zabbix cd /var/backups/zabbix # Take dump (enter MySQL root password when asked) mysqldump -u root -p --single-transaction --routines --triggers --events zabbix | gzip > zabbix_backup.sql.gz # Verify dump ls -lh zabbix_backup.sql.gz gzip -t zabbix_backup.sql.gz && echo "Backup OK" Step 2: Stop Zabbix services systemctl stop zabbix-server zabbix-agent systemctl stop apache2  # or nginx if used systemctl stop zabbix-server zabbix-agent systemctl stop apache2  # or nginx if used Step 3: Simulate DB crash (drop database) mysql -u root -p  DROP DATABASE IF EXISTS zabbix; SHOW DATABASES; Step 4: Recreate empty database mysql -u root -p -e "CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;" Step 5: Restore from backup gunzip < /var/backups/zabbix/zabbix_backup.sql.gz | mysql -u root -p zabbix Step 6: Start Zabbix services again systemctl start mysql systemctl start zabb...