tech.gate.io blog
xymon netapp vfiler quota monitoring
since we moved our nfs-servers from standalone AIX to netapp, we need a separate monitoring
I wrote this script, it runs on the xymon server, and appears as a server test
you need to change the (v)filers etc/host.equiv file, to allow rsh access from your xymon server
If that's a problem, this script may run from any system, where the bb client binary is available for.
alot of the code ist just for nice xymon formatting, it can easily be optimized for performance, without using temp files
#!/usr/bin/ksh
#Daffi 2009
#Script reads quota report from a netapp vfiler over rsh
#change vfilers host.equiv, and add the ipaddress from the rsh client, xymon server in most cases
#for testing purpose, should be set in your xymon environment
#BBHOME="/home/hobbit/client"
#BB="${BBHOME}/bin/bb"
#BBDISP=xxx.xxx.xxx.xxx
#MACHINE=xxx
TESTNAME="netappquota"
FILERNAME="xxx"
#critial and fatal severity limit, critcal=yellow, fatal=red
CLIMIT="70"
FLIMIT="80"
#don't change these values, default status
STAT="green"
STATUSTEXT="all Qtree Quotas OK"
#remove files from the last test
find $BBHOME/tmp -type f -name "netapp*.txt" -exec rm {} \;
rsh ${FILERNAME} "quota report" | awk '/vol/{print $4,$5,$6,$9}' | while read QTREE USED QUOTA RPATH
do
PERC=$(echo "scale=3;(${USED} * 100) / $QUOTA" | bc)
stf=$(echo "${PERC} >= ${FLIMIT}" | bc)
stc=$(echo "${PERC} >= ${CLIMIT}" | bc)
if [ ${stf} -eq 1 ]
then
echo "&red ${RPATH} ${QTREE} ${PERC}% ${USED} ${QUOTA}" >> $BBHOME/tmp/netappquotared.txt
elif [ ${stc} -eq 1 ]
then
echo "&yellow ${RPATH} ${QTREE} ${PERC}% ${USED} ${QUOTA}" >> $BBHOME/tmp/netappquotayellow.txt
else
echo "&green ${RPATH} ${QTREE} ${PERC}% ${USED} ${QUOTA}" >> $BBHOME/tmp/netappquotagreen.txt
fi
done
if [ -f $BBHOME/tmp/netappquotayellow.txt ] ; then STAT=yellow ; STATUSTEXT="One or more Quotas over defined CRITICAL level (${CLIMIT}%)" ; fi
if [ -f $BBHOME/tmp/netappquotared.txt ] ; then STAT=red ; STATUSTEXT="One or more Quotas over defined FATAL level (${FLIMIT}%)" ; fi
${BB} ${BBDISP} "status ${MACHINE}.${TESTNAME} ${STAT} ${STATUSTEXT}
$(echo "Path Qtree %used used[MB] quota[MB]" | awk '{printf ("%-43s" "%-30s" "%-15s" "%-15s" "%-15s\n",$1,$2,$3,$4,$5,$6)}')
$([ -f $BBHOME/tmp/netappquotared.txt ] && cat $BBHOME/tmp/netappquotared.txt | sort -rnk 4 | awk '{printf ("%-5s" "%-40s" "%-30s" "%-15s" "%-15.2f" "%-15.2f\n",$1,$2,$3,$4,$5/1024,$6/1024)}' && echo " ")
$([ -f $BBHOME/tmp/netappquotayellow.txt ] && cat $BBHOME/tmp/netappquotayellow.txt | sort -rnk 4 | awk '{printf ("%-8s" "%-40s" "%-30s" "%-15s" "%-15.2f" "%-15.2f\n",$1,$2,$3,$4,$5/1024,$6/1024)}' && echo " ")
$([ -f $BBHOME/tmp/netappquotagreen.txt ] && cat $BBHOME/tmp/netappquotagreen.txt | sort -rnk 4 | awk '{printf ("%-7s" "%-40s" "%-30s" "%-15s" "%-15.2f" "%-15.2f\n",$1,$2,$3,$4,$5/1024,$6/1024)}')
"
Sidebar
Wiki
Sidebar
Last blog posts
-
tivoli itm 6.2 change agent hostname to other then original system hostname
Tue 15 of Mar., 2011 19:17 CET
-
X11 secure display forwarding via ssh error
Tue 15 of Mar., 2011 19:03 CET
-
Android 2.2.1 delay between accepting call and actually hearing the caller
Tue 15 of Mar., 2011 18:50 CET
-
AIX: Get PVID directly from hdisk using od
Thu 15 of Apr., 2010 15:25 CEST
-
Power Blade: Add additional vscsi adapters to lpar / vhosts to vio server
Wed 24 of Mar., 2010 09:49 CET
-
Bug in xymon 4.3.3 Beta 2 splitncv
Tue 23 of Feb., 2010 10:11 CET
-
Analysing screen and browser window sizes reported by AWStats using R
Thu 18 of Feb., 2010 14:14 CET
-
Nagios on FreeBSD
Wed 27 of Jan., 2010 13:24 CET
-
Freebsd sendmail via Exchangeserver
Thu 17 of Dec., 2009 10:39 CET
-
xymon netapp vfiler quota monitoring
Tue 24 of Nov., 2009 17:55 CET
Last blog post comments
- Postfix sender address rewriting, changing mails "from" field in header on relay server: Sysadmin Jimbob Fri 03 of Feb., 2012 05:49 CET
- xymon installation tutorial ( formerly hobbit and bigbrother ): unix GPING Tue 24 of Jan., 2012 15:01 CET
- Android 2.2.1 delay between accepting call and actually hearing the caller: Good info Pharmd920 Tue 17 of Jan., 2012 13:25 CET
- Unix Color Terminal: Good info Pharma974 Sat 14 of Jan., 2012 03:39 CET
- Unix Color Terminal: Good info Pharmg936 Sat 14 of Jan., 2012 03:38 CET
- Unix Color Terminal: Good info Pharmg853 Sat 14 of Jan., 2012 03:37 CET
- Unix Color Terminal: Good info Pharmg490 Sat 14 of Jan., 2012 03:36 CET
- Unix Color Terminal: Good info Pharma756 Sat 14 of Jan., 2012 03:36 CET
- grep for a whole paragraph : AhVoyX , [url=http://kqktybpuksit.com/]kqktybpuksit[/url], [link=http://wuwcbscwywdy.com/]wuwcbscwywdy[/link], http://eagcveeedqkp.com/ cretcuzr Tue 20 of Dec., 2011 18:28 CET
- xymon netapp vfiler quota monitoring: EBVKOk , [url=http://ivrrcthzsmil.com/]ivrrcthzsmil[/url], [link=http://vzaimslyktkf.com/]vzaimslyktkf[/link], http://rslyzybrpzrp.com/ mzmeenwx Tue 20 of Dec., 2011 17:40 CET

1 2 3 4
Post new comment