#!/bin/bash source /usr/local/bin/notifications.sh disk_usage() { df -h / | grep / | awk -v max="$1" '{ usage = $5; gsub("%", "", usage); if (usage > max) { printf "🚨 WARNING:\nDisk usage is at %d%%. which exceed the treshold of %d%%.\n\n", usage, max; } printf "💾 Disk Usage Information:\nTotal Size: %s, Used: %s, Available: %s\n\n", $2, $3, $4; }' } send_notification "$(disk_usage 80)"