hvac-kia-content/systemd/hvac-monitoring.service
Ben Reed dc57ce80d5 Add comprehensive monitoring and alerting system
- Created SystemMonitor class for health check monitoring
- Implemented system metrics collection (CPU, memory, disk, network)
- Added application metrics monitoring (scrapers, logs, data sizes)
- Built alert system with configurable thresholds
- Developed HTML dashboard generator with real-time charts
- Added systemd services for automated monitoring (15-min intervals)
- Created responsive web dashboard with Bootstrap and Chart.js
- Implemented automatic cleanup of old metric files
- Added comprehensive documentation and troubleshooting guide

Features:
- Real-time system resource monitoring
- Scraper performance tracking and alerts
- Interactive dashboard with trend charts
- Email-ready alert notifications
- Systemd integration for production deployment
- Security hardening with minimal privileges
- Auto-refresh dashboard every 5 minutes
- 7-day metric retention with automatic cleanup

Alert conditions:
- Critical: CPU >80%, Memory >85%, Disk >90%
- Warning: Scraper inactive >24h, Log files >100MB
- Error: Monitoring failures, configuration issues

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-18 21:35:28 -03:00

38 lines
No EOL
837 B
Desktop File

[Unit]
Description=HVAC Know It All Content Monitoring
After=network.target
Wants=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/hvac-kia-content/monitoring/setup_monitoring.py
ExecStartPost=/usr/bin/python3 /opt/hvac-kia-content/monitoring/dashboard_generator.py
# Run as the hvac user
User=hvac
Group=hvac
# Working directory
WorkingDirectory=/opt/hvac-kia-content
# Environment
Environment=PYTHONPATH=/opt/hvac-kia-content
Environment=PATH=/usr/local/bin:/usr/bin:/bin
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=hvac-monitoring
# Security settings
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/opt/hvac-kia-content
NoNewPrivileges=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
[Install]
WantedBy=multi-user.target