A simple and powerful system resource monitoring tool that tracks CPU, Memory, and Disk usage in real-time.
- π₯οΈ Real-time CPU usage monitoring
- πΎ Memory usage tracking
- πΏ Disk space monitoring
- π Auto-refresh display
- π± Optional Telegram bot integration
- π³ Docker support
- π― Cross-platform (Windows, Linux, macOS)
- Clone this repository:
git clone https://github.com/yourusername/ResourceMonitorCli.git
cd ResourceMonitorCli
- Copy the example environment file:
cp .env.example .env
- Run with Docker Compose:
docker-compose up -d
The application can run in two modes:
- Shows metrics directly in your terminal
- Updates every second by default
- No additional configuration needed
Example output:
=== Resource Monitor ===
Timestamp: 2025-02-11T13:43:29.3309060Z
CPU Usage: 22.00%
Memory Usage: 99.00%
Disk Usage:
/ - Used: 94.58% Free: 12 GB / Total: 228 GB
/System/Volumes/VM - Used: 94.58% Free: 12 GB / Total: 228 GB
/System/Volumes/Preboot - Used: 94.58% Free: 12 GB / Total: 228 GB
/System/Volumes/Update - Used: 94.58% Free: 12 GB / Total: 228 GB
/System/Volumes/Data - Used: 94.58% Free: 12 GB / Total: 228 GB
... and more mounted volumes ...
- Sends metrics to your Telegram chat
- Requires Telegram bot token and chat ID
- Set custom update intervals
Variable | Description | Default | Required |
---|---|---|---|
TZ | Timezone | UTC | No |
TELEGRAM_TOKEN | Telegram bot token | empty | No |
CHAT_ID | Telegram chat ID | empty | Yes (if using Telegram) |
INTERVAL_MINUTES | Telegram update interval in minutes | 5 | No |
The application accepts the following command-line arguments, which are automatically set from environment variables in Docker:
Argument | Short | Description | Example |
---|---|---|---|
--telegram | -t | Telegram bot token | -t your_bot_token |
--chat | -c | Telegram chat ID | -c your_chat_id |
--interval | -i | Update interval in minutes | -i 60 |
- Without
-t
argument: Console Mode (updates every second) - With
-t
argument: Telegram Mode (requires-c
for chat ID)
- Console Mode (default):
TZ=UTC
# No other variables needed
- Telegram Mode:
TZ=UTC
TELEGRAM_TOKEN=your_bot_token
CHAT_ID=your_chat_id
INTERVAL_MINUTES=5 # optional
- Create a Telegram bot using @BotFather
- Get your chat ID using @userinfobot
- Update your
.env
file:
TELEGRAM_TOKEN=your_bot_token
CHAT_ID=your_chat_id
INTERVAL_MINUTES=5
- Docker
- Docker Compose
- 128MB RAM minimum
- Root/sudo access (for system metrics)
- Memory: 256MB limit
- Memory reservation: 128MB
The tool monitors:
- π CPU Usage %
- π Memory Usage %
- πΎ Disk Usage for all mounted drives
- Used space
- Free space
- Total capacity
-
No CPU metrics (0%)
- Check if running with proper permissions
- Verify system monitoring access
-
Container won't start
- Ensure Docker has privileged access
- Check system resources
- Verify environment variables
-
Telegram bot not responding
- Verify bot token and chat ID
- Ensure internet connectivity
- Check bot permissions
- The container runs in privileged mode to access system metrics
- Mounted volumes are read-only
- Environment variables are used for sensitive data
- No root access inside container
MIT License - feel free to use and modify!
Contributions are welcome! Please feel free to submit a Pull Request.