Reliably Backing Up
your Zabbix Instanceoicts.com

Nathan Liefting
Zabbix trainer / Consultant

Your Zabbix partner in:• The Netherlands• United Kingdom• United States

28 May 2024

Event name• Zabbix support• Zabbix training• Zabbix consultancy• And more…

https://www.linkedin.com/company/opensource-ict-solutions/
28 May 2024

oicts.com

3Components
Zabbix server
Zabbix database
Zabbix frontend
Frontend

Database
Configuration
Collected metrics

Internal communications

28 May 2024

Zabbix backups

ServerComponents
Zabbix proxy
Zabbix Java gateway
Zabbix web service
JavagatewayZabbix web service
28 May 2024

Zabbix backups

ServerProxy

Backups overview

Zabbix core components
ServerDatabase
Frontend

Config files and scripts
Full/config database backups
Config files and certificates

Additional components
ProxyJava gateway
Web service

28 May 2024

Config files, no database
Config files
Config files

Zabbix backups

Databasextrabackup/mariadbbackup (full physical backup)
xtrabackup/mariadbbackup (full physical backup)
xtrabackup/mariadbbackup (incremental physical backup)
mysqldump (logical backup)
binary logging
Replication

TABLE
historyhistory_uint
history_text

history_str
The mysqldump is the most popular MySQL backup method.
safe, but slow (e.g. 100GB/1 hour)
may cause performance degradation

history_log

Xtra/mariadb backup has more recovery options and better performance.

events28 May 2024

Zabbix backups

trendstrends_uint

Database full backup
MySQL (MariaDB/Percona)
Making the backup:

Restoring the backup:

Or use mysqlimport

28 May 2024

Zabbix backups

Database full backup
PostgreSQL
Making the backup:

Restoring the backup:

28 May 2024

Zabbix backups

Database config backup
mysqldump ' + database +’ \--ignore-table='+ database +'.events \--ignore-table='+ database +'.history \--ignore-table='+ database +'.history_log \--ignore-table='+ database +'.history_str \--ignore-table='+ database +'.history_text \--ignore-table='+ database +'.history_uint \--ignore-table='+ database +'.trends \--ignore-table='+ database +'.trends_uint \--ignore-table='+ database +'.event_recovery \--ignore-table='+ database +’.etc.etc.etc.etc \…..
-u' + username + ' \-p' + password + '28 May 2024

TABLE
historyhistory_uint
history_text

history_str
history_log
trendstrends_uint
eventsZabbix backups

Database cloud storage
So in the cloud, where to store the backup file?
Extra disk on the MySQL database?
S3 buckets:

28 May 2024

Zabbix backups

Database cloud storage
S3 bucket pricing:

EC 2 storage

28 May 2024

Zabbix backups

Database cloud storage

mysqldump zabbix | /usr/local/bin/aws s3 cp - s3://customer-zbx-backup/full-backups/zabbix-db_full.sql

28 May 2024

Zabbix backups

Database backup compression

mysqldump zabbix | lz4 > zabbix-db_full.sql.lz4

28 May 2024

Zabbix backups

Server/Frontend: Files
Server:

Frontend:/etc/zabbix/*
All Zabbix configuration files/etc/nginx/*/etc/httpd/*/usr/lib/zabbix/*
Best-practice location for Zabbix custom scripts

28 May 2024

Zabbix backups/etc/apache2/*Extra component: Files
Possibly on a different device:/etc/zabbix/*
Proxy, Java gateway and Web service config file location/usr/lib/zabbix/*
Best-practice location for Zabbix proxy custom scripts

28 May 2024

Zabbix backups

Configuration exports
Database backups are slow to make, but also slow to import back. Frontend backup imports are nearly instant!

Templates
Hosts
Media types

Maps
Images (through maps)

28 May 2024

Zabbix backups

Configuration exports

28 May 2024

Zabbix backups

Configuration exports

28 May 2024

Zabbix backups

Configuration exports: APIPossible on everything like in the frontend:
Hosts
Templates
Media types
Mapsimages
And more…
Host groups
Template groups (6.2)

28 May 2024

Zabbix backups

Configuration exports: API
Request body:

28 May 2024

Zabbix backups

Configuration exports: API
Response body:

28 May 2024

Zabbix backups

What else?

Snapshots
Use external network locations
Not a backup but…. Think about High-availability

28 May 2024

Zabbix backups

Questions?

28 May 2024

Zabbix backups