A modular system monitor based on Bash that shows a live terminal dashboard with bars for CPU, RAM, and disk usage, the top processes, threshold alerts, logging, and reporting when the system shuts down.
Entrypoint:
syswatch.sh
- Features
- Requirements
- Install
- Usage
- Configuration
- Logging & reports
- Project structure
- License
- Author
- A live, refreshing dashboard with colored progress bars that shows CPU, RAM, disk, and top processes
- Alerts based on thresholds (CPU/RAM/disk) with the option to get desktop notifications through "notify-send"
- Logging that lasts and cleanup of old logs
- Graceful "Ctrl+C": makes a report before quitting
- Modes:-
--onceto take just one picture- "report" to make a report from existing logs and leave
- Bash (uses
source,[[ ]], and(( ))) - Common tools:
awk,df,find,hostname,nproc,ps,sleep,uptime, anddate- Not required: - "tput" (better at finding the width of the terminal)
- "notify-send" (alerts on the desktop)
Make scripts executable:
chmod +x syswatch.sh alerts/*.sh logger/*.sh modules/*.sh reports/*.sh utils/*.shRun the live dashboard:
./syswatch.shSingle snapshot (no loop):
./syswatch.sh --onceCustom refresh interval (seconds):
./syswatch.sh --interval 10Generate a report from existing logs and exit:
./syswatch.sh --reportHelp:
./syswatch.sh --helpEdit config/thresholds.conf:
CPU_THRESHOLD(default80)RAM_THRESHOLD(default75)DISK_THRESHOLD(default90)MONITOR_INTERVAL(default5)LOG_RETENTION_DAYS(default7)ENABLE_NOTIFY(1enablesnotify-sendif available)
Logs/ is where the runtime outputs are written:
- The metrics log is in
logs/syswatch.log(appended).- Reports:logs/reports/report_YYYYMMDD_HHMMSS.txt(made with--reportorCtrl+C)
syswatch/
├── syswatch.sh
├── README.md
├── LICENSE
├── config/
│ └── thresholds.conf
├── modules/
│ ├── cpu_monitor.sh
│ ├── ram_monitor.sh
│ ├── disk_monitor.sh
│ └── process_monitor.sh
├── alerts/
│ └── alert_engine.sh
├── logger/
│ └── logger.sh
├── reports/
│ └── report_gen.sh
└── utils/
├── colors.sh
└── helpers.sh
GNU GPLv3 — see LICENSE.
- GitHub: @ragibcs