jonnymp316
IS-IT--Management
Hi, ok so I run a program called vmquery.exe and it gives me this output:
============================================================
Media ID: SM1014
media type: DLT cartridge tape (11)
barcode: SM1014
description: ---
volume pool: SCRATCH (2)
robot type: TLD - Tape Library DLT (8)
robot number: 0
robot slot: 8
robot host: usca1cs-nb1
volume group: 00_000_TLD
created: 06/06/2003 10:45:10 PM
assigned: ---
last mounted: ---
first mount: ---
expiration date: ---
number of mounts: 0
max mounts allowed: ---
============================================================
All I want to be able to do is to get just the Media ID number from the binary output so I am using this script:
@rc=`vmquery -rn 0 -h usca1cs-nb1`;
open STORE, ">stored.txt";
my $name;
foreach $line (@rc) {
if (index $line, "media ID"
{
print STORE $line;
}
}
close STORE;
All I ever get in my txt file is all the other information minus the Media ID line so it looks like this in the text file:
==================================================
media ID: SM1014
media type: DLT cartridge tape (11)
barcode: SM1014
description: ---
volume pool: SCRATCH (2)
robot type: TLD - Tape Library DLT (8)
robot number: 0
robot slot: 8
robot host: usca1cs-nb1
volume group: 00_000_TLD
created: 06/06/2003 10:45:10 PM
assigned: ---
last mounted: ---
first mount: ---
expiration date: ---
number of mounts: 0
max mounts allowed: ---
==================================================
Can anyone help. I am a perl newbie.
-Jonathan
============================================================
Media ID: SM1014
media type: DLT cartridge tape (11)
barcode: SM1014
description: ---
volume pool: SCRATCH (2)
robot type: TLD - Tape Library DLT (8)
robot number: 0
robot slot: 8
robot host: usca1cs-nb1
volume group: 00_000_TLD
created: 06/06/2003 10:45:10 PM
assigned: ---
last mounted: ---
first mount: ---
expiration date: ---
number of mounts: 0
max mounts allowed: ---
============================================================
All I want to be able to do is to get just the Media ID number from the binary output so I am using this script:
@rc=`vmquery -rn 0 -h usca1cs-nb1`;
open STORE, ">stored.txt";
my $name;
foreach $line (@rc) {
if (index $line, "media ID"
print STORE $line;
}
}
close STORE;
All I ever get in my txt file is all the other information minus the Media ID line so it looks like this in the text file:
==================================================
media ID: SM1014
media type: DLT cartridge tape (11)
barcode: SM1014
description: ---
volume pool: SCRATCH (2)
robot type: TLD - Tape Library DLT (8)
robot number: 0
robot slot: 8
robot host: usca1cs-nb1
volume group: 00_000_TLD
created: 06/06/2003 10:45:10 PM
assigned: ---
last mounted: ---
first mount: ---
expiration date: ---
number of mounts: 0
max mounts allowed: ---
==================================================
Can anyone help. I am a perl newbie.
-Jonathan