VM Monitor is a terminal-based tool that provides real-time monitoring of system resources across multiple Linux virtual machines. Built entirely with shell scripts, it offers a centralized view of CPU, memory, and disk usage with visual indicators and configurable alerts.
- Monitor multiple VMs from a central location
- Track CPU, memory, and disk usage with automatic refreshing
- ASCII bar graphs with color-coded status indicators
- Configurable warning and critical thresholds with notification system
- Run in interactive mode with a dashboard UI or as a background daemon
- Minimal dependencies, works on any Linux system with SSH access
- Linux/Unix environment
- Bash shell
- SSH access to target VMs
- Core utilities: bc, curl, mail (optional)
git clone https://github.com/yourusername/vm-monitor.git
cd vm-monitor./install.shvi config.shEdit config.sh to set up your VMs and alert thresholds
VMS=(
"vm1:user@vm1_ip"
"vm2:user@vm2_ip"
# Add more VMs
)
# Threshold settings (%)
CPU_WARNING=70
CPU_CRITICAL=90
MEM_WARNING=80
MEM_CRITICAL=95
DISK_WARNING=75
DISK_CRITICAL=90
# Monitoring interval (seconds)
REFRESH_INTERVAL=5
# Alert settings (beta)
ENABLE_EMAIL_ALERTS=true
EMAIL_ADDRESS="[email protected]"Run the dashboard in interactive mode with:
./monitor.shIn this mode, you'll see a real-time dashboard with color-coded resource bars.
qto quitrto manually refresh
Run the monitoring script in the background:
./monitor.sh --daemonThis will collect metrics and trigger alerts without displaying the dashboard.
vm-monitor/
├── README.md
├── install.sh # Dependency installation script
├── config.sh # Configuration file
├── monitor.sh # Main monitoring script
├── lib/
│ ├── collect_metrics.sh # Metric collection functions
│ ├── display.sh # Dashboard display functions
│ ├── alert.sh # Alert management functions
│ └── utils.sh # Utility functions
├── logs/ # Log directory
└── data/ # Metrics data directory
For testing purposes, you can use Multipass to create VMs:
multipass launch --name test-vm1
multipass launch --name test-vm2
multipass launch --name test-vm3
- Monitoring major system service health
- Verifying Port Accessibility
- Automate service restart options
- Network performance metrics
- Disk cleanup automation