Monitoring for websites + Real-Time Security Analysis with Prometheus and Grafana
π Language: English | Portuguese
- File:
dashboards/blackbox_exporter_dashboard.json
- Monitors: Sites with Status, SSL, DNS Lookup and response times
- Updates: Real-time###
- File:
dashboards/server_metrics_dashboard.json
- Monitors: CPU, Memory, Disk, Server inodes
- Updates: Every 5 minutes###
- File:
dashboards/hybrid_security_dashboard.json
- Monitors: Hybrid security (external + internal)
- Updates: Every 15 minutes###
- File:
dashboards/realtime_bot_dashboard.json
- Monitors: Bots vs Users, Attacks, Suspicious IPs
- Updates: Every 2 minutes
# Start all services
./monitor.sh start
# Stop all services
./monitor.sh stop
# Restart complete system
./monitor.sh restart
# View status of all components
./monitor.sh status
# View service logs
./monitor.sh logs
# Test complete functionality
./monitor.sh test
# Configure automatic startup
./monitor.sh install-autostart
# Remove automatic startup
./monitor.sh uninstall-autostart
IMPORTANT: Before using the system, clone the repository and configure the data files:
git clone https://github.com/rodineicosta/server-monitor.git
cd server-monitor
# Copy the example file
cp configs/sites.conf.example configs/sites.conf
# Edit with your real data
nano configs/sites.conf
# Copy the example file
cp configs/realtime_config.json.example configs/realtime_config.json
# Edit with your configurations
nano configs/realtime_config.json
# Edit the template file
nano configs/crontab/crontab.txt
# Replace [PROJECT_DIR] with absolute path
# Replace [SSH_SERVER] with your SSH server
# Then apply: crontab configs/crontab/crontab.txt
./setup.sh
Service | Port | Function |
---|---|---|
Prometheus | 9090 | Collects and stores metrics |
Pushgateway | 9091 | Receives custom metrics |
Blackbox Exporter | 9115 | Monitors sites externally |
Bot Monitor | - | Real-time log analysis |
π dashboards/ # 4 main Grafana dashboards
βοΈ configs/ # Configurations (prometheus.yml, blackbox.yml)
π§ scripts/ # Python and Shell scripts
π logs/ # All log files
π§ services/ # Running service PIDs
- Prometheus: http://localhost:9090
- Pushgateway: http://localhost:9091
- Blackbox Exporter: http://localhost:9115
The system can be configured to start automatically after macOS reboot through LaunchAgent.
./monitor.sh install-autostart
./monitor.sh uninstall-autostart
# Disable temporarily
launchctl unload ~/Library/LaunchAgents/com.monitoring.autostart.plist
# Re-enable
launchctl load ~/Library/LaunchAgents/com.monitoring.autostart.plist
- Uptime/Downtime of all sites
- HTTP response time
- SSL/TLS status and certificate validity
- Server metrics (CPU, RAM, Disk)
- Traffic analysis (Bots vs Users)
- Attack detection and suspicious IPs
- Hybrid security score (0-100)
- External Monitoring: Via Blackbox Exporter
- Internal Monitoring: Via log analysis
- Hybrid Security: Combination of both
- Bot Detection: AI to classify traffic
- Security Alerts: Anomalies and attacks
- Grafana: Visual alerts in dashboards
- System: Detailed logs for analysis
- Zero sensitive data exposure in repository
- External configuration files for sensitive data
- Template-based configuration system
- Real SSH log collection with fallback to examples
- Portable scripts with relative paths
- Status: β System fully operational and automated
- Last update: July 17, 2025
- Author: @rodineicosta
- License: MIT