A small collection of standalone CLI tools for monitoring system resource pressure on Linux.
This project focuses on decision-oriented monitoring — extracting meaningful signals from the OS and encoding clear OK / WARNING outcomes suitable for automation.
cli-system-monitor/
├── disk_management.sh
├── memory_management.sh
├── process_monitor.sh
└── logs/
├── disk_management.log
└── processes.log
Each script is independent and designed to be executed individually.
Informational snapshot of process-level CPU activity.
Purpose
- Reports total number of running processes
- Displays top CPU-consuming processes
- Appends results to a log file
Design note
This script is intentionally non-alerting.
It provides visibility rather than automated decisions.
Log
logs/processes.log
Threshold-based disk pressure monitor.
Purpose
- Evaluates filesystem usage using
df - Compares usage against a configurable threshold
- Emits explicit OK / WARNING states
- Returns automation-safe exit codes
Configuration
THRESHOLD=25 ./disk_management.shThreshold-based memory pressure monitor using kernel data.
Purpose
- Reads memory statistics directly from
/proc/meminfo - Uses
MemAvailable(notMemFree) to assess real memory pressure - Computes available memory as a percentage
- Emits explicit OK / WARNING states
- Returns automation-safe exit codes
Why MemAvailable
Linux aggressively uses memory for caching.
Low free memory does not necessarily indicate pressure.
MemAvailable represents the amount of memory that can be allocated
without swapping, making it the correct signal for monitoring.
Configuration
MEM_THRESHOLD=20 ./memory_management.sh