A comprehensive, production-ready system monitoring web application built with Flask and Python. Monitor your systems in real-time with historical data storage, intelligent alerting, multi-server support, and enterprise-grade deployment options.
- Features
- Screenshots
- Technology Stack
- Quick Start
- Installation
- Configuration
- Deployment
- API Documentation
- Architecture
- Testing
- Contributing
- License
- CPU Monitoring:
- Track usage percentage, frequency, and temperature (Celsius/Fahrenheit)
- Interactive Details: Click on the tile to view top processes sorted by CPU usage
- Memory Tracking:
- Monitor RAM usage with total, used, and available statistics
- Track swap memory usage (used/total)
- Interactive Details: Click on the tile to view top processes sorted by Memory usage
- Disk Usage:
- View usage statistics for all mounted partitions
- Interactive Analysis: Click on any partition to view a breakdown of the largest directories and file counts
- Visual Usage Bars: Directory list includes visual progress bars indicating relative size
- Disk I/O:
- Track read/write operations and data transfer rates
- Visual Breakdown: Doughnut chart showing Read vs Write ratio
- Process Breakdown: Click on Read/Write values to see which processes are generating the most I/O load
- Network Monitoring:
- Bandwidth usage and packet counts
- Active connections with real-time traffic graph
- Interactive Connection Details: Click on Connections or Established values to view detailed network connection information including:
- Protocol (TCP/UDP)
- Local and remote addresses with ports
- Connection status with color-coded badges
- Process ID and process name
- Filterable views (all connections or established only)
- Live Updates: Configurable refresh intervals (1s, 2s, 5s, 10s, 30s)
- Database Integration: SQLAlchemy ORM with PostgreSQL/SQLite support
- Metric Storage: Automatic collection every 60 seconds
- Data Retention: Configurable retention policy (default: 30 days)
- Historical Charts: View trends over time (hours, days, weeks)
- Data Export: Export metrics to CSV or JSON with date range filtering
- Process Monitoring: View all running processes with PID, name, user, CPU%, memory%
- Search & Filter: Real-time process search functionality
- Process Control: Kill processes (admin only)
- Auto-Refresh: Live process list updates every 3 seconds
- Process Details: Detailed information for individual processes
- Threshold Monitoring: Configure alerts for CPU, memory, disk, temperature, network
- Multiple Notification Channels:
- Email alerts via SMTP (Flask-Mail)
- SMS alerts via Twilio
- Slack Notifications: Rich alerts via Slack Webhooks
- Flexible Rules:
- Comparison operators (>, <, >=, <=, ==)
- Configurable thresholds
- Duration settings (avoid false positives)
- Per-server or global rules
- Alert History: Full logging with timestamps and acknowledgment tracking
- Test Notifications: Test email/SMS/Slack before activating rules
- Service Monitoring: Monitor uptime and response time of external websites/APIs
- Protocol Support: HTTP/HTTPS and TCP checks
- Status Dashboard: Dedicated health dashboard with real-time status indicators
- Performance Tracking: Track response times and error rates
- Background Monitoring: Automated checks every 60 seconds
- Agent-Based Architecture: Monitor multiple servers from one dashboard
- Server Management: Add, edit, and remove servers
- Health Tracking: Last seen timestamps and status indicators
- API Key Authentication: Secure server-to-server communication
- Automatic Registration: Local server auto-registered on first run
- Secure Authentication: Flask-Login with bcrypt password hashing
- User Management:
- Registration with validation
- Login/logout functionality
- Profile management (email, password changes)
- Role-Based Access Control:
- Admin users (first user is auto-admin)
- Regular users
- Permission-based features (e.g., process killing)
- Session Management: Remember me functionality
- User Preferences:
- Refresh interval configuration
- Chart data points (30, 60, 120, 300)
- Theme selection (dark, light, auto)
- Default server selection
- Notification preferences
- Per-User Settings: Each user maintains their own preferences
- Multiple Formats:
- CSV export with human-readable formatting
- JSON export with structured metadata
- Flexible Filtering:
- Date range selection
- Server filtering
- Metric type selection (system, network, or both)
- Automatic Downloads: Proper MIME types and timestamped filenames
- Docker Containerization:
- Multi-stage Dockerfile for optimized builds
- Docker Compose for full stack (app + PostgreSQL + Redis)
- Health checks and automatic restarts
- Non-root user for security
- Kubernetes Deployment:
- Complete manifest set (10 files)
- StatefulSet for PostgreSQL with persistent storage
- ConfigMap and Secret management
- Horizontal scaling (2 app replicas)
- Ingress with TLS support
- Resource limits and requests
- Liveness and readiness probes
- Responsive Design: Works on desktop, tablet, and mobile
- Dark Theme: Eye-friendly with glassmorphism effects
- Sidebar Navigation: Easy access to all features
- Interactive Charts: Chart.js visualizations
- Interactive Network Connections: Click connections to view detailed information in modal popups
- Enterprise-grade Icons: Professional FontAwesome icons for sidebar navigation
- Flash Messages: User feedback with animations
- Smooth Animations: Micro-interactions for enhanced UX
- Drag-and-Drop Dashboard: Customizable widget layout using Gridstack.js
- Widget Macros: Reusable, modular dashboard components
- Standardized Window Management: Consistent, draggable, and resizable modals with z-index handling across the application
Note: The application features a premium dark mode interface with gradient accents, real-time charts (including network traffic), and smooth animations.
- Flask 3.0+ - Web application framework
- SQLAlchemy - ORM for database operations
- Flask-Login - User session management
- Flask-Mail - Email notifications
- Flask-Migrate - Database migrations
- psutil - System and process utilities
- APScheduler - Background task scheduling
- Gunicorn - Production WSGI server
- bcrypt - Password hashing
- Twilio - SMS notifications
- pandas - Data export functionality
- HTML5 - Semantic markup
- CSS3 - Modern styling with custom properties
- JavaScript (Vanilla) - Real-time updates and interactions
- Chart.js - Interactive charts
- Google Fonts (Outfit) - Typography
- PostgreSQL - Production database
- SQLite - Development database
- Redis - Task queue backend
- Docker - Containerization
- Kubernetes - Orchestration
- Nginx - Reverse proxy (deployment)
# Clone the repository
git clone <repository-url>
cd "System Monitor App"
# Copy environment file
cp .env.example .env
# Edit .env with your configuration
nano .env
# Start all services
docker-compose up -d
# Access the application
open http://localhost:5000Default credentials (first user becomes admin):
- Create your account at
/auth/register
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Set up environment
cp .env.example .env
# Run migrations
flask db upgrade
# Start development server
python run.pyAccess at http://localhost:5000
- Python 3.11 or higher
- PostgreSQL 15+ (production) or SQLite (development)
- Redis 7+ (for background tasks)
- Node.js (optional, for frontend development)
-
Clone and Setup
git clone <repository-url> cd "System Monitor App" python3 -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Configure Environment
cp .env.example .env
Edit
.envwith your settings:# Flask Configuration FLASK_ENV=development SECRET_KEY=your-secret-key-here # Database (use PostgreSQL for production) DATABASE_URL=postgresql://user:password@localhost/system_monitor # Redis REDIS_URL=redis://localhost:6379/0 # Email Alerts MAIL_SERVER=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=your-email@gmail.com MAIL_PASSWORD=your-app-password # SMS Alerts (optional) TWILIO_ACCOUNT_SID=your-account-sid TWILIO_AUTH_TOKEN=your-auth-token TWILIO_PHONE_NUMBER=+1234567890 # Monitoring Settings METRIC_COLLECTION_INTERVAL=60 DATA_RETENTION_DAYS=30
-
Initialize Database
flask db upgrade
-
Run Application
# Development python run.py # Production gunicorn -w 4 -b 0.0.0.0:5000 "app:create_app('production')"
| Variable | Description | Default | Required |
|---|---|---|---|
FLASK_ENV |
Environment (development/production) | development | No |
SECRET_KEY |
Session encryption key | - | Yes (production) |
DATABASE_URL |
Database connection string | sqlite:///system_monitor.db | No |
REDIS_URL |
Redis connection string | redis://localhost:6379/0 | No |
MAIL_SERVER |
SMTP server hostname | smtp.gmail.com | For alerts |
MAIL_PORT |
SMTP server port | 587 | For alerts |
MAIL_USERNAME |
Email account username | - | For alerts |
MAIL_PASSWORD |
Email account password | - | For alerts |
TWILIO_ACCOUNT_SID |
Twilio account SID | - | For SMS |
TWILIO_AUTH_TOKEN |
Twilio auth token | - | For SMS |
TWILIO_PHONE_NUMBER |
Twilio phone number | - | For SMS |
METRIC_COLLECTION_INTERVAL |
Seconds between collections | 60 | No |
DATA_RETENTION_DAYS |
Days to keep metrics | 30 | No |
ALERT_CHECK_INTERVAL |
Seconds between alert checks | 60 | No |
# Generate SECRET_KEY
python -c "import secrets; print(secrets.token_hex(32))"
# Generate API key for servers
python -c "import secrets; print(secrets.token_urlsafe(32))"# Build and start
docker-compose up -d
# View logs
docker-compose logs -f app
# Stop services
docker-compose down
# Rebuild after changes
docker-compose up -d --build# Update secrets in k8s/secret.yaml first!
# Apply all manifests
kubectl apply -f k8s/
# Check deployment status
kubectl get pods
kubectl get services
# Get external IP
kubectl get service system-monitor-service
# View logs
kubectl logs -f deployment/system-monitor-app
# Scale application
kubectl scale deployment system-monitor-app --replicas=3- Set
FLASK_ENV=production - Configure secure
SECRET_KEY - Use PostgreSQL database
- Configure Redis for background tasks
- Set up email/SMS credentials
- Configure reverse proxy (Nginx)
- Set up SSL/TLS certificates
- Configure firewall rules
- Set up monitoring and logging
- Test on staging environment
- Configure backup strategy
- Set up log rotation
Register a new user account.
Request Body:
{
"username": "john_doe",
"email": "john@example.com",
"password": "securepassword123",
"confirm_password": "securepassword123"
}Authenticate user and create session.
Request Body:
{
"username": "john_doe",
"password": "securepassword123",
"remember": true
}Get real-time system metrics.
Query Parameters:
server_id(optional): Server ID to query
Response:
{
"cpu": {
"percent": 45.2,
"freq": "2400.00Mhz",
"temp_c": 55.0,
"temp_f": 131.0
},
"memory": {
"total": "16.00GB",
"used": "7.50GB",
"percent": 46.9,
"swap_total": "4.00GB",
"swap_used": "0.00B",
"swap_free": "4.00GB",
"swap_percent": 0.0
},
"network": {
"bytes_sent": "1.50GB",
"bytes_recv": "3.20GB",
"packets_sent": 1500000,
"packets_recv": 2000000
},
"connections": {
"established": 45,
"listen": 12,
"time_wait": 8,
"total": 65
}
}Get detailed network connection information.
Query Parameters:
status(optional): Filter by connection status (e.g., ESTABLISHED, LISTEN, TIME_WAIT)
Response:
{
"connections": [
{
"protocol": "TCP",
"local_address": "192.168.1.100:5000",
"remote_address": "93.184.216.34:443",
"status": "ESTABLISHED",
"pid": 1234,
"process": "chrome"
}
],
"count": 24
}Get list of processes sorted by I/O activity.
Response:
{
"processes": [
{
"pid": 1234,
"name": "chrome",
"read_bytes": 1048576,
"write_bytes": 524288,
"read_count": 150,
"write_count": 50
}
],
"count": 50
}Analyze disk usage for a specific mountpoint.
Query Parameters:
mountpoint(default: /): Mountpoint to analyze
Response:
{
"directories": [
{
"path": "/var/log",
"size": 52428800,
"size_formatted": "50.0 MB",
"file_count": 150
}
],
"mountpoint": "/",
"count": 10
}Get historical metrics data.
Query Parameters:
server_id(optional): Server IDhours(default: 24): Hours of historytype(default: system): Metric type (system/network)
Get list of running processes.
Response:
{
"processes": [
{
"pid": 1234,
"name": "python",
"username": "user",
"cpu_percent": 5.2,
"memory_percent": 2.1,
"status": "running"
}
]
}Terminate a process (admin only).
Get all alert rules for current user.
Create new alert rule.
Request Body:
{
"name": "High CPU Alert",
"metric_type": "cpu",
"threshold": 80,
"comparison": ">",
"server_id": null,
"notify_email": true,
"notify_sms": false,
"email_address": "alerts@example.com"
}Get alert history.
Export metrics to CSV.
Export metrics to JSON.
βββββββββββββββββββ
β Web Browser β
ββββββββββ¬βββββββββ
β HTTPS
βΌ
βββββββββββββββββββ
β Nginx (Proxy) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββ
β Flask App ββββββΆβ PostgreSQL β
β (Gunicorn) β β Database β
ββββββββββ¬βββββββββ ββββββββββββββββ
β
β ββββββββββββββββ
βββββββββββββββΆβ Redis β
β Task Queue β
ββββββββββββββββ
- Metric Collection: Runs every 60 seconds (configurable)
- Alert Checking: Runs every 60 seconds (configurable)
- Data Cleanup: Runs daily at 2 AM
users
βββ id (PK)
βββ username (unique)
βββ email (unique)
βββ password_hash
βββ is_admin
βββ created_at
servers
βββ id (PK)
βββ name
βββ hostname
βββ api_key
βββ is_local
βββ is_active
system_metrics
βββ id (PK)
βββ server_id (FK)
βββ timestamp
βββ cpu_percent
βββ memory_percent
βββ ...
alert_rules
βββ id (PK)
βββ user_id (FK)
βββ server_id (FK, nullable)
βββ metric_type
βββ threshold
βββ ...
The application includes a suite of unit and integration tests.
# Run all tests
python -m unittest discover tests
# Run specific test file
python -m unittest tests/test_models.py
python -m unittest tests/test_routes.py
# Run with verbose output
python -m unittest discover tests -vContributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes with tests
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Add docstrings to functions and classes
- Write tests for new features
- Update documentation as needed
- Keep commits focused and atomic
This project is licensed under the MIT License - see the LICENSE file for details.
- psutil - System monitoring capabilities
- Flask - Web framework
- Chart.js - Data visualization
- SQLAlchemy - Database ORM
- APScheduler - Background task scheduling
For issues and questions:
- Check existing documentation
- Review GitHub Issues
- Open a new issue with detailed information
- DEPLOYMENT.md - Detailed deployment guide
- API Documentation - Complete API reference
- Agent Setup - Multi-server agent configuration
Built with β€οΈ using Flask, Python, and modern web technologies
Status: β Production Ready | π³ Docker Ready | βΈοΈ Kubernetes Ready