Commit Graph

8 Commits (master)

Author SHA1 Message Date
mirivlad d03aff714f feat: Add offline monitoring and default settings
- Add offline_timeout and notify_on_offline fields to servers table
- Create default_settings table for configurable defaults
- Create offline_alerts table for tracking offline events
- Add sendOfflineNotification/sendOnlineNotification methods
- Create check_offline.php CRON script for periodic checks
- Add admin page for default settings management
- Add offline settings to server edit form
- Apply default values when creating new servers

Usage: Add to CRON - * * * * * php /var/www/mon/public/check_offline.php
2026-04-17 15:22:17 +08:00
mirivlad 6d3542232a docs: Update documentation to reflect current state
README.md:
- Fix badge line breaks
- Add migration 008_auto_cleanup_metrics.sql
- Improve architecture diagram
- Add troubleshooting section
- Add changelog
- Fix formatting

ARCHITECTURE.md:
- Update agent metrics list (net_in_*, temp_*, etc.)
- Change interval from 10s to 60s
- Fix architecture diagram

INSTALL.md:
- PHP 8.1 -> 8.3
- php8.1-fpm.sock -> php8.3-fpm.sock
- Update API example with current metrics

AGENTS.md:
- PHP 8.1 -> 8.3
- Update API endpoints with new /get-agent, /agent/install.sh

docker/README.md:
- Fix password from 'admin' to 'mirvmon2026'

TECHNICAL_SPECIFICATION.md:
- Change agent interval from 10s to 60s
- Add lm-sensors, smartmontools to agent requirements
2026-04-17 11:52:48 +08:00
mirivlad bce4c2e2d0 fix: Update agent install, disk metrics, fallback blocks, and dynamic thresholds
BREAKING: install.sh now downloads agent from server instead of embedding it

Changes:
- AgentController: downloadAgent() method for serving agent.py with token auth
- AgentController: rewrite generateInstallScript() to curl agent from server
- agent.py: copy production version from server (with temp, disk, network metrics)
- agent.py: fix get_disk_metrics() to use priority mountpoints (/, /home, etc)
- agent.py: fix disk_total_gb collection to use priority mountpoints
- detail.twig: add fallback blocks for temperatures (alert-info)
- detail.twig: add fallback blocks for disk doughnuts (alert-warning)
- detail.twig: add fallback blocks for network graphs (alert-warning)
- detail.twig: add null check for ramTotalGB in tooltip
- detail.twig: improve thresholds form with human-readable labels and units
- ServerDetailController: query only metrics that exist on server and display on graphs

For server 3 (mirv.top):
- After deploy, download new install.sh and reinstall agent
- This will add disk_used_root, ram_total_gb, temperatures support
2026-04-17 09:25:43 +08:00
mirivlad 3255bfae29 feat: auto-cleanup metrics older than 60 days
- MariaDB event scheduler: daily cleanup at 03:00
- Production: event created, event_scheduler=ON, config in /etc/mysql/mariadb.conf.d/
- Docker: --event-scheduler=ON in db service command
- Migration 008: creates event on fresh installs
- 20 servers x 1 month ≈ 1GB (vs unlimited growth)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 19:21:40 +08:00
mirivlad e4588f7044 fix: correct PHP-native bcrypt hash for admin password mirvmon2026
- Migration 007: PHP-native $2y$ hash (not Python $2b$)
- docker/.env excluded from git
- APP_PORT set to 8082 (avoid conflicts with existing nginx)
- Verified: login with admin/mirvmon2026 works correctly

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 16:34:40 +08:00
mirivlad 3ba8629146 unify config: single .env.example, default password mirvmon2026, docker in README
- .env.example moved to project root (used by both Docker and manual install)
- Migration 007: admin password = mirvmon2026 (bcrypt hash)
- docker-compose.yml reads ../.env from root
- deploy.sh generates DB passwords, shows default admin password
- README.md updated with Docker install section (Variant A) and manual (Variant B)
- Consistent default credentials everywhere: admin/mirvmon2026

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 16:20:01 +08:00
mirivlad 8938b61c78 deploy: add deploy.sh script, secure .env
- deploy.sh: auto-install docker, generate random passwords, start
- .env removed from git, added to .gitignore and .dockerignore
- Secrets are now local-only

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 15:54:16 +08:00
mirivlad 6d8bd99277 Docker: production-ready setup with immutable images, versioned migrations, env vars
- Dockerfile: PHP 8.3 FPM + composer install (no dev)
- docker-compose.yml: app + nginx + MariaDB 10.11
- Versioned migrations (001-007) with schema_migrations tracking
- DatabaseConfig.php: env vars with fallbacks
- init.sh: wait-for-db + auto-migrate
- nginx.conf: reverse proxy + gzip + security rules
- .env.example: config template
- .dockerignore: build optimization

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 15:51:14 +08:00