Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Monitor

A web application to manage and monitor servers.

Features

  • 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

Setup

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Initialize the database:
    flask db-init
    
  4. Run the migration script to set up monitoring tables (for new installations):
    python migration.py
    
  5. Run the application:
    flask run
    

Technology Stack

  • Backend: Python (Flask)
  • Frontend: HTML, CSS, JavaScript, Bootstrap
  • Database: SQLite
  • SSH Connectivity: Paramiko

Note

This application connects to servers via SSH to collect real system metrics. For proper functioning:

  1. Ensure the servers are accessible via SSH from the host running this application
  2. Provide correct SSH credentials (server IP, port, username, password)
  3. The SSH user should have sufficient permissions to read system statistics

Password Handling

IMPORTANT: This application stores SSH passwords in plaintext for simplicity. In a production environment, you should:

  1. Implement proper encryption for sensitive credentials
  2. Consider using SSH keys instead of passwords
  3. Use a secure secret management system

For added security in this demo:

  • The included migration.py script can update existing password storage
  • The reset_db.py script allows you to reset the database if needed
  • Use SSH keys with passwordless authentication where possible

Diagnostics

The application provides diagnostic tools to help troubleshoot server connection issues:

  1. 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
  2. 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 -v
    

    This provides detailed connection diagnostics independent of the main application.

About

A web application to manage and monitor servers.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages