Hi i found this script which seems to do exactly what i need - save configuration on my zabbix server, without history data for now, just templates, hosts etc.
I was able to run in, connect to my database, and dump it. Problem is that the resulting backup contains practially nothing and has almost no size. We got around 750 hosts, many custom templates and such, so i would presume the file should be fairly large.
Not sure what iam doing wrong. Please note i need to specifiy database and such, since there were some problems (this script trying to read info from zabbix_server.conf)
Any ideas why its not containing data? I tried to search web, but could not find anything. Is it possible that i need to stop the zabbix server firs? Config data are static, so iam not worried about consistency of DB dump as i dont need history.
I was able to run in, connect to my database, and dump it. Problem is that the resulting backup contains practially nothing and has almost no size. We got around 750 hosts, many custom templates and such, so i would presume the file should be fairly large.
Not sure what iam doing wrong. Please note i need to specifiy database and such, since there were some problems (this script trying to read info from zabbix_server.conf)
Any ideas why its not containing data? I tried to search web, but could not find anything. Is it possible that i need to stop the zabbix server firs? Config data are static, so iam not worried about consistency of DB dump as i dont need history.
Code:
postgres@zabbix:/home/scripts/zabbix-backup-0.9.1$ ./zabbix-dump -t psql -Z -u postgres -d zabbix -p PASSWD -H 127.0.0.1
Configuration:
- type: psql
- host: 127.0.0.1 (localhost)
- port: 5432
- database: zabbix
- user: postgres
- output: /home/scripts/zabbix-backup-0.9.1
Fetching list of existing tables...
Starting table backups...
Password:
For the following large tables only the schema (without data) was stored:
- --exclude-table-data=acknowledges
- --exclude-table-data=alerts
- --exclude-table-data=auditlog
- --exclude-table-data=auditlog_details
- --exclude-table-data=event_recovery
- --exclude-table-data=events
- --exclude-table-data=event_tag
- --exclude-table-data=history
- --exclude-table-data=history_log
- --exclude-table-data=history_str
- --exclude-table-data=history_text
- --exclude-table-data=history_uint
- --exclude-table-data=problem
- --exclude-table-data=problem_tag
- --exclude-table-data=task
- --exclude-table-data=task_acknowledge
- --exclude-table-data=task_close_problem
- --exclude-table-data=task_remote_command
- --exclude-table-data=task_remote_command_result
- --exclude-table-data=trends
- --exclude-table-data=trends_uint
Compressing backup file...
Backup Completed:
/home/scripts/zabbix-backup-0.9.1/zabbix_cfg_localhost_20190729-1204_db-psql-3.4.7.sql.gz
rm -f /tmp/tmp.mrkOqzWoTn
______________________________________________________________________________________________________________________________________
postgres@zabbix:/home/scripts/zabbix-backup-0.9.1$ zcat zabbix_cfg_localhost_20190729-1204_db-psql-3.4.7.sql.gz
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.9 (Debian 10.9-1.pgdg90+1)
-- Dumped by pg_dump version 11.4 (Debian 11.4-1.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- PostgreSQL database dump complete
--

Comment