Phase 1 Week 2: Infrastructure & Monitoring
Added comprehensive production infrastructure: Systemd Service: - guruconnect.service with auto-restart, resource limits, security hardening - setup-systemd.sh installation script Prometheus Metrics: - Added prometheus-client dependency - Created metrics module tracking: - HTTP requests (count, latency) - Sessions (created, closed, active) - Connections (WebSocket, by type) - Errors (by type) - Database operations (count, latency) - Server uptime - Added /metrics endpoint - Background task for uptime updates Monitoring Configuration: - prometheus.yml with scrape configs for GuruConnect and node_exporter - alerts.yml with alerting rules - grafana-dashboard.json with 10 panels - setup-monitoring.sh installation script PostgreSQL Backups: - backup-postgres.sh with gzip compression - restore-postgres.sh with safety checks - guruconnect-backup.service and .timer for automated daily backups - Retention policy: 30 daily, 4 weekly, 6 monthly Health Monitoring: - health-monitor.sh checking HTTP, disk, memory, database, metrics - guruconnect.logrotate for log rotation - Email alerts on failures Updated CHECKLIST_STATE.json to reflect Week 1 completion (77%) and Week 2 start. Created PHASE1_WEEK2_INFRASTRUCTURE.md with comprehensive planning. Ready for deployment and testing on RMM server.
This commit is contained in:
22
projects/msp-tools/guru-connect/server/guruconnect.logrotate
Normal file
22
projects/msp-tools/guru-connect/server/guruconnect.logrotate
Normal file
@@ -0,0 +1,22 @@
|
||||
# GuruConnect log rotation configuration
|
||||
# Copy to: /etc/logrotate.d/guruconnect
|
||||
|
||||
/var/log/guruconnect/*.log {
|
||||
daily
|
||||
rotate 30
|
||||
compress
|
||||
delaycompress
|
||||
missingok
|
||||
notifempty
|
||||
create 0640 guru guru
|
||||
sharedscripts
|
||||
postrotate
|
||||
systemctl reload guruconnect >/dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
||||
|
||||
# If using journald (systemd), logs are managed automatically
|
||||
# View logs with: journalctl -u guruconnect
|
||||
# Configure journald retention in: /etc/systemd/journald.conf
|
||||
# SystemMaxUse=500M
|
||||
# MaxRetentionSec=1month
|
||||
Reference in New Issue
Block a user