#!/bin/sh #adjust this MNTPOINT=/mnt/raid #usage is third field of the df output, last (second) line df $MNTPOINT | tail -1 | awk '{ print $3"\n"$2 }' MDSTAT=/proc/mdstat cat $MDSTAT | head -3 | tail -1 | tr -d "[]" | tr -c [0-9] " " | awk '{print $4/$5*100}'