Disk space monitoring script
📖 Scenario: You are a system administrator who wants to keep an eye on disk space usage on a server. If disk space usage goes above a certain limit, you want to be alerted so you can take action before the server runs out of space.
🎯 Goal: Build a simple bash script that checks the disk space usage of the root directory and alerts if usage is above a set threshold.
📋 What You'll Learn
Create a variable to store the disk usage percentage of the root directory
Create a variable to store the threshold percentage for alerting
Write an if statement to compare disk usage with the threshold
Print an alert message if disk usage is above the threshold
Print a safe message if disk usage is below or equal to the threshold
💡 Why This Matters
🌍 Real World
System administrators often need to monitor disk space to prevent servers from running out of storage, which can cause crashes or data loss.
💼 Career
Knowing how to write simple monitoring scripts is a key skill for DevOps engineers and system administrators to maintain healthy infrastructure.
Progress0 / 4 steps