pyZabbixBackup¶
Welcome to pyZabbixBackup’s documentation. This is a Python script that allow to dump and archive a Zabbix server database.
pyZabbixBackup can work with PostgreSQL, MySQL and MariaSQL. It can handle various formats and compressions algorithms. Backups rotation is supported. If run on the target machine, it can save the Zabbix configuration files along with the database dump.
It is compatible with Linux, Linux-like operating systems. It can work (with some caveats) with Windows.
Not production ready
Experimental, use at your own risk!
Quickstart¶
Install pyZabbixBackup in a virtual environment:
pip install zabbixdump
Perform a backup of this machine in the current directory and save the standard Zabbix configuration files:
$ python -m zabbixbackup psql --passwd - --save-files --quiet
(echo disabled for password input)
password:
/mnt/backup/zabbix_127.0.0.1_[..]
$ ls -lh zabbix_127.0.0.1_[..]
totale 4,1M
-rw-r--r-- 1 root root 0 14 dic 00.12 dump.log
drwxr-xr-x 4 root root 4,0K 14 dic 00.12 host_root
-rw-r--r-- 1 root root 14 14 dic 00.12 zabbix_dbversion
-rw-r--r-- 1 root root 4,1M 14 dic 00.12 zabbix_dump.pgdump
$ find zabbix_127.0.0.1_[..]
zabbix_127.0.0.1_[..]
zabbix_127.0.0.1_[..]/zabbix_dbversion
zabbix_127.0.0.1_[..]/host_root
zabbix_127.0.0.1_[..]/host_root/usr
zabbix_127.0.0.1_[..]/host_root/usr/lib
zabbix_127.0.0.1_[..]/host_root/usr/lib/zabbix
zabbix_127.0.0.1_[..]/host_root/usr/lib/zabbix/externalscripts
zabbix_127.0.0.1_[..]/host_root/usr/lib/zabbix/alertscripts
zabbix_127.0.0.1_[..]/host_root/etc
zabbix_127.0.0.1_[..]/host_root/etc/zabbix
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/nginx.conf
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/web
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/web/zabbix.conf.php
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/zabbix_server.conf
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/zabbix_agentd.conf
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/php-fpm.conf
zabbix_127.0.0.1_[..]/host_root/etc/zabbix/zabbix_agentd.d
zabbix_127.0.0.1_[..]/zabbix_dump.pgdump
zabbix_127.0.0.1_[..]/dump.log
Warning
Password might be exposed in clear text when saving configuration files.
Saving the configuration files might be a security hazard if the backup isn’t properly stored and protected in a safe place!