A web application to manage and monitor servers.
- User authentication (register, login)
- Server management (add, edit, delete, list)
- Real-time server monitoring via SSH connections
- CPU, memory, disk usage monitoring
- Server uptime and load average tracking
- OS and kernel information retrieval
- Dashboard with server statistics
- Auto-refreshing server status
- SSH connection support
- Server categorization by type
- Configurable monitoring parameters and alert thresholds
- Real-time monitoring and logging
- User login tracking (username, IP address, timestamp)
- Command execution monitoring (command content, user, timestamp)
- File change monitoring (modified/deleted files, users, timestamps)
- File upload tracking via FTP/SFTP (filename, size, source IP)
- Interactive command execution interface
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Initialize the database:
flask db-init - Run the migration script to set up monitoring tables (for new installations):
python migration.py - Run the application:
flask run
- Backend: Python (Flask)
- Frontend: HTML, CSS, JavaScript, Bootstrap
- Database: SQLite
- SSH Connectivity: Paramiko
This application connects to servers via SSH to collect real system metrics. For proper functioning:
- Ensure the servers are accessible via SSH from the host running this application
- Provide correct SSH credentials (server IP, port, username, password)
- The SSH user should have sufficient permissions to read system statistics
IMPORTANT: This application stores SSH passwords in plaintext for simplicity. In a production environment, you should:
- Implement proper encryption for sensitive credentials
- Consider using SSH keys instead of passwords
- Use a secure secret management system
For added security in this demo:
- The included
migration.pyscript can update existing password storage - The
reset_db.pyscript allows you to reset the database if needed - Use SSH keys with passwordless authentication where possible
The application provides diagnostic tools to help troubleshoot server connection issues:
-
Web Interface Diagnostics:
- Each server page has a "Run Diagnostic" button in the Actions section
- The diagnostic page shows detailed connection information and troubleshooting tips
-
Command-line Tester: A standalone script for testing SSH connections is included:
python server_tester.py hostname -u username [-p port] [-t timeout] [-v]Example:
python server_tester.py 192.168.1.100 -u admin -p 22 -vThis provides detailed connection diagnostics independent of the main application.