Veritas-bu

[Veritas-bu] SUMMARY: Getting a list of robots

2000-03-20 17:56:18
Subject: [Veritas-bu] SUMMARY: Getting a list of robots
From: W. Curtis Preston curtis AT colltech DOT com
Date: Mon, 20 Mar 2000 14:56:18 -0800
ORIGINAL QUESTION:

> > From veritas-bu-admin AT eng.auburn DOT edu  Mon Mar 20 14:23:11 2000
> > X-BeenThere: veritas-bu AT mailman.eng.auburn DOT edu
> >
> > OK, I've tried everything.  I want a list of robots that contains which
> > host has the robotic control.  I've been using bpstulist, but that lists
> > every media server that has a storage unit connected to that robot, not
> > just the main robotic control.  And to my knowledge, there's no way to
> > distinguish the "main" robot storage unit from the others.  What would be
> > perfect would be something like what you get from tpconfig -raw, but that
> > only works on the server you're running it on.  (I don't want to be forced
> > to rsh/ssh out to the slaves to get their robots.)

Thanks to CT's own Mike Wei, I've got a solution that finally works.
(You have no idea how long this has bugged me...)

The secret was to let vmquery do the work.  Basically I list all the 
volumes in all the robots, and slurp up the robot number and robot host 
entry from there.  Here's the perl snippet to do it.  It ends up with a 
little loop that prints out all the robots.

$vmquery_cmd='vmquery -a' ;
open(VMQUERY,"$vmquery_cmd|");

while (<VMQUERY>) {
         #Throw away all the lines except those that have these patterns
         next unless ( $_ =~ /robot number:|robot host:/ ) ;
         #Put $_ into an array
         @line=split /\s+/ ;

         #I'll hit the robot_num line first
         if ( $_ =~ /robot number:/ ) {
                 $robot_num=$line[2]
         }

         #Then I hit the robot_host line.
         else {
                 $robot_host=$line[2] ;
                 #If this isn't already a defined robot_host, then define it
                 unless ( defined ($robot_numbers{$robot_num})) {
                         $robot_numbers{$robot_num} = $robot_host ;
                 }
         }
}

foreach $robot_num ( keys %robot_numbers ) {
         print "$robot_num - $robot_numbers{$robot_num} \n";
         }
---
W. Curtis Preston, Principal Consultant at Collective Technologies
Email: curtis AT colltech DOT com                (Best way to contact me)
Work : 408 452 5555                       (Leave a message.)
Pager: 800 946 4646, pin#1436065        (If urgent.)

Tap into the Collective Intellect (TM): http://www.colltech.com
Backup & Restore resources:        http://www.backupcentral.com





<Prev in Thread] Current Thread [Next in Thread>