Re: How to create a list of all Medium ID´s? (537 Views)
Reply
Established Member
dmo09
Posts: 3
Registered: ‎04-23-2013
Message 1 of 5 (578 Views)
Accepted Solution

How to create a list of all Medium ID´s?

[ Edited ]

Hello!

 

I´m searching for a command which shows me all medium id´s.

Can you help me?

 

thanks

&

regards

Dominic

Honored Contributor
JBasilio
Posts: 540
Registered: ‎11-25-2008
Message 2 of 5 (564 Views)

Re: How to create a list of all Medium ID´s?

Hello

 

You can do it so listing pool by pool

 

omnimm -list_pool "pool name" -detail

Established Member
dmo09
Posts: 3
Registered: ‎04-23-2013
Message 3 of 5 (562 Views)

Re: How to create a list of all Medium ID´s?

Oh,

 

I have many pools to search for.

About 100!

 

Now i´m using this command to get the ID from a pool:

 

omnimm -list_pool "pool name" -detail | grep identifier

 

But it would be nice when everyone knows a command that includes all pools!

Honored Contributor
danielbraun
Posts: 752
Registered: ‎07-07-2010
Message 4 of 5 (555 Views)

Re: How to create a list of all Medium ID´s?

Hi,

 

maybe the perlscript will do the trick for you... quick and dirty, but will list you all identifiers from all pools with the poolname as headline.

 

Best regards

Daniel

 

#!perl
my $command="omnimm -list_pools -detail";
my @command=`$command 2>&1`;

foreach $command(@command)
{
 chomp $command;
 if ($command=~ /^Pool name/)
 {
  my ($dummy,$poolname)=split(/ : /,$command,2);
  $poolname=~ s/\s+$//g;
  print $poolname."\n==============================\n";
  my $command1="omnimm -list_pool \"".$poolname."\" -detail";
  my @command1=`$command1 2>&1`;
  foreach (@command1)
  {
   if ($_=~ /Medium identifier/)
   {
    my ($dummy,$identifier)=split(/ : /,$_,2);
    $identifier=~ s/\s+$//g;
    print $identifier."\n";
   }
  }
 }
}

-----------
Please assign Kudos - How to assign...
Established Member
dmo09
Posts: 3
Registered: ‎04-23-2013
Message 5 of 5 (537 Views)

Re: How to create a list of all Medium ID´s?

[ Edited ]

Hi danielbraun,

 

thanks for the solution in perl!


I have made a script in ksh for unix:

 

#!/bin/ksh

poollist=`omnimm -list_pools | grep poolnames | awk '{print $2}'`

for i in $poollist
 do
  omnimm -list_pool $i -detail | grep identifier | awk '{print $4}'
 done

 

 

regards

Dominic

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.