Veritas-bu

[Veritas-bu] Reply to Drive occupation

2003-09-18 14:23:23
Subject: [Veritas-bu] Reply to Drive occupation
From: ida3248b AT post.cybercity DOT dk (ida3248b AT post.cybercity DOT dk)
Date: Thu, 18 Sep 2003 19:23:23 +0100
Hello Robert

Here is the pure perl (activestate) script that we use on windows machines

If you're running SSO only run the script on one of the media servers.

Regards
Michael

drivekap.pl
#!/usr/bin/perl

($sec,$min,$hour,$day,$mon,$year)=localtime();
$year=$year+1900;
$mon=$mon+1;
$mon=substr("0$mon",-2,2);
$day=substr("0$day",-2,2);
$hour=substr("0$hour",-2,2);
$min=substr("0$min",-2,2);
$htime="$hour:$min";

$filename="/tsm/logs/drivekap.$year$mon$day";

@DRIVES=`/VERITAS/Volmgr/bin/vmoprcmd -d ds`;


shift @DRIVES;
shift @DRIVES;
shift @DRIVES;
shift @DRIVES;

@INUSE=(grep /Yes/, @DRIVES);
@DOWN=(grep /DOWN/, @DRIVES);
$DRIVES=scalar(@DRIVES);
$INUSE=scalar(@INUSE);
$DOWN=scalar(@DOWN);
$PCTUSE=100*$INUSE/$DRIVES;
$PCTDWN=100*$DOWN/$DRIVES;
open (OUTF, ">>$filename");

print OUTF 
$htime," ",$DRIVES," ",$INUSE," ",$DOWN," ",$PCTUSE," ",$PCTDWN,"\n";

close (OUTF);  

--
Cybercity Webhosting (http://www.cybercity.dk)


<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] Reply to Drive occupation, ida3248b AT post.cybercity DOT dk <=