| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A suite of tools to optimize and manage your OpenStack resources, with multilingual support (FR/EN).
Version 1.6.1 - Code quality improvements, security enhancements, and better reliability!
Docker deployment includes all features: Prometheus metrics collector + automated cron tasks (weekly reports, daily summaries, optimization).
# Clone the repository
git clone https://github.com/your-username/openstack-toolbox.git
cd openstack-toolbox
# Configure credentials
cp .env.example .env
nano .env
# Start the complete suite
docker-compose up -dEdit .env file with your credentials:
# OpenStack (required)
OS_AUTH_URL=https://api.pub1.infomaniak.cloud:5000/v3
OS_PROJECT_NAME=your-project
OS_USERNAME=your-username
OS_PASSWORD=your-password
OS_USER_DOMAIN_NAME=default
OS_PROJECT_DOMAIN_NAME=default
OS_REGION_NAME=RegionOne
# SMTP (optional, for email notifications)
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your-email@gmail.com
SMTP_PASSWORD=your-app-password
SMTP_FROM_EMAIL=your-email@gmail.com
SMTP_TO_EMAIL=recipient@example.com
# Timezone
TZ=Europe/ParisNote for Gmail: Use an app password, not your regular password.
# View logs
docker-compose logs -f
# Check status
docker-compose ps
# Restart
docker-compose restart
# Stop
docker-compose down
# Rebuild after code changes
docker-compose up -d --build
# Execute commands manually
docker exec openstack-toolbox python -m src.openstack_summary
docker exec openstack-toolbox python -m src.openstack_optimization
# View cron jobs
docker exec openstack-toolbox crontab -l
# View specific logs
docker exec openstack-toolbox tail -f /var/log/openstack-toolbox/weekly-notification.logYou can easily customize when tasks run by setting environment variables in your .env file:
# Cron format: minute hour day month weekday
CRON_WEEKLY_REPORT=0 8 * * 1 # Monday at 8:00 AM (default)
CRON_DAILY_SUMMARY=0 9 * * * # Every day at 9:00 AM (default)
CRON_OPTIMIZATION=0 10 * * * # Every day at 10:00 AM (default)Common examples:
# Weekly report on Friday at 5:00 PM
CRON_WEEKLY_REPORT=0 17 * * 5
# Daily summary at 6:00 AM
CRON_DAILY_SUMMARY=0 6 * * *
# Optimization every 6 hours
CRON_OPTIMIZATION=0 */6 * * *
# Run every 30 minutes
CRON_OPTIMIZATION=*/30 * * * *
# Multiple times per day (8 AM and 8 PM)
CRON_DAILY_SUMMARY=0 8,20 * * *Cron format reference:
| Field | Values | Examples |
|---|---|---|
| Minute | 0-59 | 0, */15, 30 |
| Hour | 0-23 | 8, */6, 9,17 |
| Day | 1-31 | 1, 15, */2 |
| Month | 1-12 | *, 1,6,12 |
| Weekday | 0-7 (0=Sunday) | 1 (Monday), 1-5 (weekdays) |
After changing schedules, restart the container:
docker-compose restartAdd to your prometheus.yml:
scrape_configs:
- job_name: 'openstack-toolbox'
static_configs:
- targets: ['openstack-toolbox:8000']
scrape_interval: 60s
scrape_timeout: 30sCreate docker-compose.override.yml:
version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
ports:
- "9090:9090"
volumes:
- ./docker/prometheus.yml.example:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
networks:
- monitoring
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-data:/var/lib/grafana
networks:
- monitoring
volumes:
prometheus-data:
grafana-data:Start everything: docker-compose up -d
Container won't start:
docker-compose logs
docker-compose down -v
docker-compose build --no-cache
docker-compose up -dMetrics not available:
curl http://localhost:8000/metrics
docker-compose logs | grep -i errorCron tasks not running:
docker exec openstack-toolbox ps aux | grep cron
docker exec openstack-toolbox crontab -l
docker exec openstack-toolbox service cron statusEmail not sent:
docker exec openstack-toolbox env | grep SMTP
docker exec openstack-toolbox tail -f /var/log/openstack-toolbox/weekly-notification.loggit clone https://github.com/your-username/openstack-toolbox.git
cd openstack-toolbox
# Install in development mode
pip install -e .
# Or use directly with Docker
docker-compose up -dThe toolbox supports two methods for configuring OpenStack credentials:
export OS_AUTH_URL=https://your-auth-url
export OS_PROJECT_NAME=your-project
export OS_USERNAME=your-username
export OS_PASSWORD=your-password
export OS_USER_DOMAIN_NAME=your-domain
export OS_PROJECT_DOMAIN_NAME=your-project-domain
export OS_REGION_NAME=your-regionOS_AUTH_URL=https://your-auth-url
OS_PROJECT_NAME=your-project
OS_USERNAME=your-username
OS_PASSWORD=your-password
OS_USER_DOMAIN_NAME=your-domain
OS_PROJECT_DOMAIN_NAME=your-project-domain
OS_REGION_NAME=your-regionChoose the method that best suits your workflow. The toolbox will automatically detect and use the credentials from either source.
SMTP configuration is interactive. Run:
weekly-notificationThe script will guide you to configure:
Once the container is running with docker-compose up -d, everything runs automatically:
# Resource summary
docker exec openstack-toolbox python -m src.openstack_summary
# Optimization analysis
docker exec openstack-toolbox python -m src.openstack_optimization
# Send weekly notification
docker exec openstack-toolbox python -m src.weekly_notification_optimization
# View metrics
curl http://localhost:8000/metricsIf you installed from source:
# Metrics collector
openstack-metrics-collector
# Resource summary
openstack-summary
# Administration
openstack-admin
# Weekly notifications
weekly-notificationThe collector exposes these metrics on port 8000:
Create an alert.yml file with these example rules:
groups:
- name: openstack_alerts
rules:
- alert: OpenStackInstanceDown
expr: openstack_instance_status == 0
for: 5m
labels:
severity: critical
annotations:
summary: "Instance {{ $labels.instance_name }} is down"
description: "Instance {{ $labels.instance_name }} in project {{ $labels.project_name }} has been down for more than 5 minutes"
- alert: OpenStackHighCPUUsage
expr: openstack_instance_cpu_usage > 90
for: 15m
labels:
severity: warning
annotations:
summary: "High CPU usage on {{ $labels.instance_name }}"
description: "Instance {{ $labels.instance_name }} has had CPU usage above 90% for 15 minutes"
- alert: OpenStackLowDiskSpace
expr: openstack_volume_free_space / openstack_volume_total_space * 100 < 10
for: 10m
labels:
severity: warning
annotations:
summary: "Low disk space on volume {{ $labels.volume_name }}"
description: "Volume {{ $labels.volume_name }} has less than 10% free space"Add this file to your Prometheus configuration to enable alerting on common OpenStack issues.
The project supports French (default) and English. To change the language, use:
openstack-toolbox --configThis will display an interactive menu to select your preferred language. The choice will be saved and used across all tools in the suite.
You can also view all available commands in your preferred language with:
openstack-toolboxopenstack-toolbox/ ├── src/ # Python source code (12 modules) └── .github/ # GitHub Actions CI/CD
Core Modules:
Utility Modules (v1.6.0):
# Reconfigure SMTP to enable encryption
weekly-notification# Install the new security dependency
pip install cryptography>=41.0.0Configuration files now have restricted permissions:
If you encounter decryption errors:
# Remove old configuration
rm ~/.config/openstack-toolbox/smtp_config.ini
rm ~/.config/openstack-toolbox/.encryption_key
# Reconfigure
weekly-notificationFixed:
Improved:
Security:
No breaking changes - Full backward compatibility maintained
Added:
Security:
No breaking changes - Full backward compatibility maintained
Contributions are welcome! Feel free to:
See docs/IMPROVEMENTS.md for technical details.
Special thanks to Kevin Allioli, Cloud Architect & SysAdmin, for his valuable contributions and expertise in OpenStack development.
This project is under Apache License 2.0. See LICENSE.TXT file for more details.
Developed by Loutre
| Back | FazBrowse Home | New Git URL |