Thursday, September 04, 2008

Nagios Plug-In for Veritas Netbackup Scartch Pool check

To monitor the tapes in our library wich is a t a remote data center, we had a script running wich each morning mails us a report with the tapes count for each "Volume Pool" in our netbackup infrastructure. But as you may know sysadmins like to make their life easier so I wanted to be informed by our Nagios monitoring system when our Scratch pool was reaching certain tape counts so we could take action accordingly wihtout having to look to those mails each morning. So I came up with this little script.

#!/bin/bash

WARN_COUNT=$1
CRIT_COUNT=$2


SCRATCH_TMP=`/usr/openv/volmgr/bin/vmquery -b -pn Scratch_pool | wc -l`
SCRATCH_COUNT=$[$SCRATCH_TMP - 3]


if [ $SCRATCH_COUNT -lt $WARN_COUNT ];then
if [ $SCRATCH_COUNT -lt $CRIT_COUNT ];then
echo "Scratch count CRITICAL : availbale scratch tapes $SCRATCH_COUNT less then $CRIT_COUNT|scratch=$SCRATCH_COUNT;$WARN_COUNT;$CRIT_COUNT"
exit 2
else
echo "Scratch count WARNING : available scratch tapes $SCRATCH_COUNT less then $WARN_COUNT|scratch=$SCRATCH_COUNT;$WARN_COUNT;$CRIT_COUNT"
exit 1
fi
else
echo "Scratch count OK : available scratch tapes $SCRATCH_COUNT|scratch=$SCRATCH_COUNT;$WARN_COUNT;$CRIT_COUNT"
exit 0
fi
exit 3



Now our nice nagios installation will warn me when I need to do something , so I just need to wait for a mail to take action, instead of having to remember each morning to look at those mails. find the "Scratch pool" look at the tape count.

3 comments:

Anonymous said...

I am in fact thankful to the owner of this site who has shared this wonderful piece of writing at at this place.


Also visit my web page; pirater un compte facebook

Anonymous said...

My partner and I stumbled over here coming from a different web address and thought I should check things out.
I like what I see so i am just following you. Look forward to checking out your web page again.


Have a look at my web page - Generateur de Code PSN

Anonymous said...

What's up, after reading this amazing post i am too happy to share my know-how here with mates.

Here is my weblog: Microsoft Office Gratuit