back to scripts

check_nas_usage.sh

bash 24 lines secrets redacted

NAS capacity check with threshold warnings.

Note Live script from my home-lab server. Tokens, IDs, phone numbers and other secrets have been replaced with placeholders like <WHATSAPP_GROUP_ID> — everything else is the real, running code.
#!/bin/bash

NAS_PATH="/mnt/nas"

echo "=== Checking processes using NAS path: $NAS_PATH ==="
echo

echo "=== lsof output (processes touching NAS) ==="
sudo lsof +D "$NAS_PATH" 2>/dev/null
echo

echo "=== Top processes by disk I/O (iotop) ==="
sudo iotop -b -n 5 -o | head
echo

echo "=== Network usage per process (nethogs 5-second sample) ==="
sudo nethogs -t -c 5
echo

echo "=== Docker containers using NAS-mounted volumes ==="
docker ps --format "table {{.Names}}\t{{.Mounts}}"
echo

echo "=== Done ==="

back to scripts