#!/bin/sh
set -eu
umask 077
: "${PROXY_DB:?set an existing SQLite proxy database path}"
: "${SNAPSHOT_DIR:?set a private snapshot directory}"
mkdir -p "$SNAPSHOT_DIR"
zabbix_proxy --version > "$SNAPSHOT_DIR/version.txt"
# Run against an offline copy, or after a controlled collection/drain window.
sqlite3 "$PROXY_DB" 'PRAGMA quick_check;' > "$SNAPSHOT_DIR/sqlite-check.txt"
sqlite3 "$PROXY_DB" '.schema' > "$SNAPSHOT_DIR/schema.sql"
# These diagnostics do not prove that the server received every buffered value.
