#!/usr/bin/perl -w use strict; use Data::Dumper; my $debug = 1; $ENV{PATH} .= ":/usr/openv/netbackup/bin:/usr/openv/netbackup/bin/goodies:/usr/openv/netbackup/bin/admincmd:/usr/openv/volmgr/bin:/usr/openv/volmgr/bin/goodies:/usr/openv/man:/usr/openv/man/share/man:/usr/openv/netbackup/bin/goodies/man"; undef(my $sched); my $pol_print = 0; my $sched_print = 0; my (%poolnums_by_name, $pool_name, $pool_num); undef $pool_name; undef $pool_num; foreach my $line (qx{vmpool -listall}) { if ($line =~ m/^=/) { $poolnums_by_name{$pool_name} = $pool_num if defined($pool_name); undef $pool_name; undef $pool_num; } elsif ($line =~ m/^pool number:/) { $pool_num = (split(' ', $line))[2]; } elsif ($line =~ m/^pool name:/) { $pool_name = (split(' ', $line))[2]; } } foreach my $pol (qx{bppllist}) { chomp($pol); foreach my $line (qx{bppllist $pol -l}) { chomp($line); print "[$line]\n" if ($debug > 1); if ($line =~ m/^POOL /) { foreach my $pool (split(' ', $line)) { unless ($pool =~ m/^POOL$/ || $pool =~ m/^NetBackup$/) { print "$pol, default: $pool ($poolnums_by_name{$pool}) "; $pol_print = 1; } } if ($pol_print) { print "\n"; $pol_print = 0; } } elsif ($line =~ m/^SCHED /) { $sched = (split(' ', $line))[1]; } elsif ($line =~ m/^SCHEDPOOL /) { die "SCHEDPOOL before SCHED?" unless defined($sched); foreach my $pool (split(' ', $line)) { unless ($pool =~ m/^SCHEDPOOL$/ || $pool =~ m/^\*NULL\*$/) { print "\n$pol, $sched: $pool "; $sched_print = 1; } } undef($sched); if ($sched_print) { print "\n"; $sched_print = 0; } } } }