A comprehensive CLI-based infrastructure health scanner for Ubuntu servers. This tool performs deep system analysis including security audits, resource monitoring, network scanning, and more - all from a beautiful terminal interface.
- Beautiful colored terminal output using Rich library
- Easy-to-navigate menu system
- Real-time progress indicators
- Comprehensive reporting
- Full System Scan - Runs all modules and provides overall health score
- System Information - OS, hardware, CPU, memory, and disk information
- Security Audit - Firewall, SSH config, failed logins, SUID binaries, open ports
- Resource Monitor - CPU, RAM, swap usage, top processes
- Network & Ports Scan - Network interfaces, listening ports, active connections
- Package & Vulnerabilities - Package status, security updates, OS version
- Docker Status - Container and image information
- Log Analysis - Authentication logs, system errors, disk warnings
- Process Monitor - Running processes, zombie detection, resource usage
- Ubuntu 18.04 or later (tested on Ubuntu 20.04/22.04)
- Python 3.6 or later
- Root/sudo access for full functionality
# Clone or download the project
cd server-scanner
# Install required Python packages
pip3 install -r requirements.txt
# Make the scanner executable
chmod +x scanner.py
# Run the scanner
sudo ./scanner.py# Install Python dependencies
pip3 install rich==13.7.0
# Ensure the following system tools are available (usually pre-installed):
# - ss (iproute2)
# - ps (procps)
# - df, free (coreutils)
# - dmidecode (for hardware detection)
# - apt (package management)Simply run the scanner and choose from the menu:
sudo ./scanner.py╔════════════════════════════════════════════════════════════╗
║ SERVER HEALTH SCANNER v1.0 ║
║ Comprehensive Infrastructure Monitor ║
╚════════════════════════════════════════════════════════════╝
[1] Full System Scan (Run Everything)
[2] System Information Only
[3] Security Audit
[4] Resource Monitor (CPU/RAM/Disk)
[5] Network & Ports Scan
[6] Package & Vulnerabilities
[7] Docker Status
[8] Log Analysis
[9] Process Monitor
[0] Exit
- Operating System version and kernel
- Hostname and uptime
- Architecture (x86_64, ARM, etc.)
- Platform detection (Physical hardware, VMware, VirtualBox, KVM)
- CPU model, cores, and current usage
- RAM and swap usage with visual indicators
- Disk usage for all mounted filesystems
- Firewall status (UFW, iptables, firewalld)
- SSH configuration (root login, password auth, custom port)
- Failed SSH login attempts
- Security modules (AppArmor, SELinux)
- World-writable files detection
- Users with UID 0
- Empty password users
- Open ports with risk assessment
- SUID/SGID binary detection
- Real-time CPU usage with visual bars
- Memory (RAM) usage and availability
- Swap usage
- System load average (1, 5, 15 min)
- Top 5 CPU-consuming processes
- Top 5 memory-consuming processes
- Disk I/O statistics
- Network interfaces with IP addresses and status
- Link speed for physical interfaces
- All listening ports (TCP/UDP)
- Process information for each port
- Active network connections
- Routing table
- Total installed packages count
- Available package updates
- Pending security updates (CRITICAL)
- Unattended-upgrades status
- Last update timestamp
- OS version and support status
- Kernel update availability
- Docker version and daemon status
- Docker socket permission check
- Running and stopped containers
- Container resource usage
- Docker images with sizes
- Docker networks and volumes count
- Successful and failed SSH login attempts
- Recent failed login details (IP, user, count)
- Sudo command usage
- System errors in syslog
- Out of Memory (OOM) events
- Systemd service failures
- Disk space warnings
- I/O errors
- Network interface events
- Process overview (total, running, sleeping, stopped, zombie)
- Zombie process detection and listing
- Top processes by CPU and memory
- High CPU usage processes (>10%)
- High memory usage processes (>5%)
- Process count by user
- Long-running processes
Runs all modules sequentially and provides:
- Overall health score (0-100)
- Critical issues summary
- Warnings summary
- Good status items
- Comprehensive system report
Many scanning features require root/sudo access:
- Reading system logs (
/var/log/*) - Accessing network information
- Reading security-sensitive files
- Hardware information via
dmidecode
Always run with sudo:
sudo ./scanner.py- Does NOT modify any system settings
- Does NOT install or remove packages
- Does NOT restart services
- Does NOT make firewall changes
- Read-only analysis and reporting only
- All scanning is local - no data sent externally
- No telemetry or analytics
- Results stay on your system unless you export them
Run with sudo: sudo ./scanner.py
Install dependencies: pip3 install -r requirements.txt
Docker is optional. Install with: sudo apt install docker.io
Check that log files exist and are readable:
ls -la /var/log/auth.log
ls -la /var/log/syslogInstall dmidecode: sudo apt install dmidecode
server-scanner/
├── scanner.py # Main entry point
├── requirements.txt # Python dependencies
├── README.md # This file
├── modules/ # Scanning modules
│ ├── __init__.py
│ ├── system_info.py # System information
│ ├── security.py # Security audit
│ ├── resources.py # Resource monitoring
│ ├── network.py # Network scanning
│ ├── packages.py # Package management
│ ├── docker.py # Docker status
│ ├── logs.py # Log analysis
│ ├── processes.py # Process monitoring
│ └── full_scan.py # Full system scan
└── utils/ # Utility functions
├── __init__.py
├── display.py # Rich formatting
└── helpers.py # Command execution
- Language: Python 3
- UI Framework: Rich (terminal formatting)
- System Commands: Pure bash via subprocess
- No external APIs: Everything runs locally
- Minimal external dependencies
- Use built-in Linux commands
- Beautiful, professional CLI output
- Modular architecture for easy extension
- Read-only, non-invasive scanning
- Ubuntu 20.04 LTS
- Ubuntu 22.04 LTS
- Ubuntu 24.04 LTS
- Debian 11/12 (should work)
This project demonstrates:
- Python programming and system administration
- Linux command-line tools expertise
- Security awareness and best practices
- Clean, maintainable code architecture
- Professional CLI application development
- Infrastructure monitoring knowledge
- DevOps skills
Potential additions for v2.0:
- Save reports to JSON/TXT files
- Remote server scanning via SSH
- Scheduled scanning with cron
- Email alerts for critical issues
- Historical trend analysis
- Custom alert thresholds
- Export to CSV/PDF
- Service-specific health checks
- Database performance analysis
This is a portfolio project, but improvements are welcome:
- Bug reports
- Feature suggestions
- Code improvements
- Documentation updates
Free to use for educational and portfolio purposes.
Created as a DevOps portfolio project demonstrating infrastructure monitoring and system administration skills.
- Built with Rich for beautiful terminal output
- Inspired by tools like htop, netstat, and various system monitoring utilities
- Thanks to the Ubuntu/Debian community for excellent documentation
Note: This tool is designed for legitimate system administration and educational purposes only. Always ensure you have proper authorization before scanning any system.