Veritas-bu

[Veritas-bu] script to show usage of tape drives on a media server

2005-04-13 12:12:16
Subject: [Veritas-bu] script to show usage of tape drives on a media server
From: ewilts AT ewilts DOT org (Ed Wilts)
Date: Wed, 13 Apr 2005 11:12:16 -0500
On Wed, Apr 13, 2005 at 09:40:27AM -0600, Benton, Daniel wrote:
> I'm trying to find a script that will show the amount of time each tape
> drive on a media server is used during the day.
> 
> I don't need any graphic - just the tape drive name and the amount of
> time in use.

We capture snapshots of vmdareq and parse that out to feed into mrtg.
You can base your code on something like this:

[root@osiris crontabs]# cat /usr/openv/local/drive-count.sh
#!/bin/sh

OUT=/usr/openv/local/drive-count.dat
PATH=$PATH:/usr/openv/volmgr/bin

date=`date '+%Y-%m-%d %H:%M'`
count=`vmdareq | grep AVAILABLE | wc -l | awk '{print $1}'`
down=`vmdareq | grep DOWN | wc -l | awk '{print $1}'`

echo "$date $count $down" >> $OUT

-- 
Ed Wilts, Mounds View, MN, USA
mailto:ewilts AT ewilts DOT org