This project is a lightweight Bash script designed to provide a quick "health check" of a Linux server. It was created to practice essential Linux administration skills, such as reading system metrics and automating monitoring tasks, which are fundamental for any Cloud/DevOps role.
The script provides a high-level report on three critical areas of the server:
- Disk Usage: Checks the usage percentage of the root (
/) filesystem. - RAM Usage: Checks the amount of free (available) memory in Megabytes.
- Service Status: Checks if a specific, user-defined service (e.g.,
nginx) is actively running.
It compares these metrics against predefined thresholds and reports an [OK], [UYARI!] (Warning), or [KRİTİK!] (Critical) status for each.
- (Optional) Open the
health_check.shscript and change the variables in the--- Configuration ---section (likeDISK_THRESHOLD,RAM_THRESHOLD,SERVICE_NAME) to match your needs. - Make the script executable:
chmod +x health_check.sh
- Run the script:
./health_check.sh
- Bash Scripting (Variables,
if/elselogic) - Linux Core Utilities:
date,echo - System Monitoring Commands:
df(to check disk usage)free(to check RAM usage)systemctl(to check service status)
- Text Processing:
awk,sed(to parse command outputs and extract specific values)