As thanks to the list for help on this, here's a quickie that I wrote for a
report we needed, in case
it's useful to anyone else:
#!/usr/bin/perl
#
# Quick report showing barcode tags, volume pools, and sorting by
# volume pool counts. -Jay 08/04
#
@RuleList = `vmrule -listall`;
for $line (@RuleList) {
chomp($line);
if ($line =~ "barcode") {
($a, $b, $prefix) = split(" ",$line);
}
if ($line =~ "pool") {
($a, $b, $pool) = split(" ",$line);
$Pool{$prefix} = $pool;
}
}
@Vm = `vmquery -a`;
for $line (@Vm) {
chomp($line);
if ($line =~ "barcode:") {
($a, $barcode) = split(" ",$line);
$prefx = substr($barcode, 0, 3);
$Count{$prefx}++;
$PoolCount{$Pool{$prefx}}++;
}
}
open(FH, ">/tmp/pool.rep$$");
for my $barcode (sort keys %Pool) {
if (! exists $Count{$barcode}) { $Count{$barcode} = 0; }
printf(FH "%-4s %5s %20s Total for pool
=
%4s\n",$barcode,$Count{$barcode},$Pool{$barcode},$PoolCount{$Pool{$barcode}});
}
close(FH);
$w = `sort -nr +7 /tmp/pool.rep$$ > /tmp/pool.sorted.$$`;
open(FH2, ">>/tmp/pool.head.$$");
printf(FH2 "%-4s %5s %20s Total for pool
= %4s\n","Code","Count","Pool","PoolTot");
print FH2
"--------------------------------------------------------------------\n";
close(FH2);
$w = `cat /tmp/pool.sorted.$$ >> /tmp/pool.head.$$`;
$w = `cat /tmp/pool.head.$$`;
print "$w";
unlink("/tmp/pool.rep$$");
unlink("/tmp/pool.sorted.$$");
unlink("/tmp/pool.head$$");
From: James M Sherman on 08/26/2004 10:18 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
cc:
Subject: Command to see which bar codes are in which volume pools?
Hello,
How can I generate a report showing which bar code tags are assigned to which
volume pools?
I need to see something like:
OSF Off_Site_Full
...
Where "OSF" is a bar code tag and Off_Site_Full is it's assigned volume pool.
I can get this in the GUI via Inventory Robot--> Barcode rules, but I can't cut
& paste
that stuff, and I need a command-line method.
Thanks!
Jay Sherman
james_sherman AT uhc DOT com
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
|