Simple helpers to validate influxdbs
ValidFlux provides two simple Python scripts to work with InfluxDB:
- influxdb_stats.py - List statistics from an InfluxDB instance
- validate_backup.py - Validate InfluxDB backup files and archives
Install the required dependencies:
pip install -r requirements.txtList statistics from an InfluxDB instance:
# Basic usage (localhost)
python influxdb_stats.py
# Connect to remote host
python influxdb_stats.py --host influxdb.example.com --port 8086
# With authentication
python influxdb_stats.py --host localhost --user admin --password secret
# Detailed stats (includes measurement counts and time ranges)
python influxdb_stats.py --detailed
# With SSL
python influxdb_stats.py --host localhost --sslOptions:
--host- InfluxDB host (default: localhost)--port- InfluxDB port (default: 8086)--user- Username for authentication--password- Password for authentication--database- Specific database to query (default: all databases)--detailed- Show detailed statistics including point counts and time ranges--ssl- Use SSL connection
Validate an InfluxDB backup directory or archive:
# Validate a backup directory
python validate_backup.py /path/to/backup
# Validate a backup archive
python validate_backup.py /path/to/backup.tar.gzOptions:
backup_path- Path to backup directory or archive file (required)
The script validates:
- Backup directory/archive existence and readability
- Manifest file (if present)
- Database directories and files
- File counts and sizes
python influxdb_stats.pypython influxdb_stats.py --host 192.168.1.100 --user admin --password mypass --detailedpython validate_backup.py /var/lib/influxdb/backuppython validate_backup.py /backups/influxdb-2024-01-01.tar.gz- Python 3.6+
- influxdb-python library
MIT