From 999a7ebf564d31c5b029a8eb217871c2fcac7d41 Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Mon, 24 Dec 2018 22:12:14 -0500 Subject: [PATCH] new script to check freespace in afs trivial script. if this proves annoying when/if we pass 85% used, may want to use quotacheck as a basis for a more advanced script (and back off over time if usage stops increasing). --- check-openafs-freespace | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 check-openafs-freespace diff --git a/check-openafs-freespace b/check-openafs-freespace new file mode 100755 index 0000000..fb06abf --- /dev/null +++ b/check-openafs-freespace @@ -0,0 +1,8 @@ +#!/bin/bash +# Check afs partitions for free space problems + +THRESHOLD=85 + +df -h --output=target,pcent,used,avail | grep ^/vicep | sed -e s/%// | awk "{if (\$2 > $THRESHOLD) print}" | while read partition pcent used avail; do + echo "${used} used, ${avail} available. Consider resizing partition." | mail -s "$(hostname) AFS partition ${partition} ${pcent}% full" log+afs@hcoop.net +done -- 2.20.1