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)}')
"

Image

57 comments


private message
why do you use rsh instead of ssh ?


private message
ultram ptpd cialis mensl


Page: 1/7  [Next]
1  2  3  4  5  6  7 

Post new comment

Anti-Bot verification code image
Try another code

Last blog post comments

  1. xymon netapp vfiler quota monitoring: rvksjfq sjmgafs 01:26 CEST
  2. Use Windows as router / NAT traffic: vnvrfihp muygzxbi Sat 19 of May, 2012 16:18 CEST
  3. mount nfs v3 share under Solaris 10: kdvwtux xqowacnm Sat 19 of May, 2012 04:21 CEST
  4. Unix Color Terminal: cbeusw ejbpsnr Sat 19 of May, 2012 01:29 CEST
  5. AIX: Get PVID directly from hdisk using od: buy penis enlargement penis_enlargement Fri 18 of May, 2012 15:14 CEST
  6. AIX: Get PVID directly from hdisk using od: risperdal risperdal Fri 18 of May, 2012 13:00 CEST
  7. AIX: Get PVID directly from hdisk using od: cheap phen375 phen375 Wed 16 of May, 2012 18:30 CEST
  8. AIX: Get PVID directly from hdisk using od: Good info Pharmk935 Mon 14 of May, 2012 23:06 CEST
  9. Unix Color Terminal: Good info Pharmd119 Sun 13 of May, 2012 15:49 CEST
  10. Test network throughput without disk or cpu distortion: Good info Pharmd585 Sun 13 of May, 2012 06:01 CEST

Feeds List