A powerful web-based server monitoring application that connects to multiple servers via SSH and displays real-time resource usage metrics with beautiful progress bars and responsive UI.
- Real-time Monitoring: Monitor CPU, RAM, and disk usage across multiple servers
- SSH Connection: Secure SSH connections to remote servers (password or key-based auth)
- Beautiful UI: Modern, responsive interface with progress bars and status indicators
- Auto-refresh: Automatically refreshes metrics every 30 seconds
- Connection Testing: Test SSH connections before adding servers
- Multi-server Support: Monitor unlimited number of servers simultaneously
- Error Handling: Graceful handling of connection failures and errors
- CPU Usage: Real-time CPU utilization percentage
- Memory Usage: RAM usage with total/used capacity
- Disk Usage: Disk utilization with total/used space
- Server Status: Online/offline indicators
- Connection Health: Visual status indicators for each server
- Python 3.8 or higher
- pip3 package manager
- SSH access to target servers
- Linux/Unix target servers (tested on Ubuntu, CentOS, Debian)
-
Clone the repository:
git clone <your-repo-url> cd watchtower
-
Run the startup script:
./start.sh
The script will:
- Create a virtual environment
- Install all dependencies
- Start the Flask server
-
Access the application: Open your browser and navigate to:
http://localhost:5000
If you prefer manual setup:
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the application
cd backend
python app.py-
Click the "Add Server" button
-
Fill in the server details:
- Server Alias: Friendly name (optional)
- Host/IP Address: Server IP or hostname
- SSH Port: Usually 22
- Username: SSH username
- Password: SSH password (optional if using key auth)
- SSH Key Path: Path to private key file (optional)
-
Click "Test Connection" to verify connectivity
-
Click "Add Server" to start monitoring
- Refresh Individual Server: Click the refresh button on any server card
- Refresh All Servers: Click "Refresh All" to update all servers
- Remove Server: Click the trash icon to remove a server
- Auto-refresh: Servers automatically refresh every 30 seconds
watchtower/
├── backend/
│ └── app.py # Flask application and SSH monitoring logic
├── frontend/
│ ├── templates/
│ │ └── index.html # Main HTML template
│ └── static/
│ ├── styles.css # CSS styling
│ └── script.js # JavaScript functionality
├── requirements.txt # Python dependencies
├── start.sh # Startup script
├── .gitignore # Git ignore file
└── README.md # This file
The application provides a REST API:
GET /- Main web interfaceGET /api/servers- List all configured serversPOST /api/servers- Add a new serverDELETE /api/servers/<server_id>- Remove a serverGET /api/metrics/<server_id>- Get metrics for a specific serverGET /api/metrics/all- Get metrics for all serversPOST /api/test-connection- Test SSH connection
- SSH Keys: Use SSH key authentication when possible instead of passwords
- Network Security: Run on a secure network or use VPN
- User Permissions: Use limited SSH users with minimal required permissions
- Firewall: Configure firewalls appropriately
- HTTPS: For production, serve over HTTPS using a reverse proxy
Connection Timeouts:
- Verify SSH port is accessible
- Check firewall settings
- Ensure SSH service is running on target server
Permission Denied:
- Verify username and password/key
- Check SSH user permissions
- Ensure SSH key has correct permissions (600)
Metrics Not Loading:
- Check if target server has required commands (
top,free,df) - Verify user has permission to execute system commands
To run in debug mode for development:
export FLASK_DEBUG=1
cd backend
python app.py- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
- Built with Flask web framework
- SSH connectivity via Paramiko library
- UI icons from Font Awesome
- Responsive design principles
For issues and questions:
- Check the troubleshooting section
- Open an issue on GitHub
- Review the code for customization options
Happy Monitoring! 🚀📊