Check Disk Space

#!/bin/bash
#AJS - 08/12/2010 moved from ops01 and rewritten.

# Pull the current connections per server
#ssh -i ~/.ssh/id_dsa rng16

LOG=/var/www/html/cacti/output/diskspace.log

#delete old log file
rm ${LOG}

#rng16 used sdb for some unknown reason... so we cannot loop through rng16
for RNGO in rng01 rng02 rng03 rng14 rng15
do
        RNGRES=`ssh -i ~/.ssh/id_dsa -b 172.27.206.210 ${RNGO} "df -m | grep /dev/sda2" | awk '{print $4}'`
        echo -n "${RNGO}:${RNGRES} " >> ${LOG}
done

#finish off with rng16
RNGRES=`ssh -i ~/.ssh/id_dsa -b 172.27.206.210 rng16 "df -m | grep /dev/sdb1" | awk '{print $4}'`
echo -n "rng16:${RNGRES} " >> ${LOG}

#finish log file with cr
echo "" >> ${LOG}

exit 0

rb/checkringospace.txt · Last modified: 10/10/2013 15:21 (external edit)