For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

robertoq_79472's avatar
robertoq_79472
Icon for Nimbostratus rankNimbostratus
Sep 02, 2009

Get ALL virtual server names?

Hi There,

 

 

Fairly new to using iControl. I've been going through the API reference and I don't seem to find a way to get a list of ALL the virtual servers currently on my LTM. I want to be able to get the full list and then the pool-names followed by their respective members and IPs.

 

 

Has anyone done this already?

14 Replies

  • if you have virtuals not in the common partition, you'll need to set the partition first:

     
     my $Partition = SOAP::Lite 
               -> uri('urn:iControl:Management/Partition') 
               -> proxy("https://yourBigIP/"."/iControl/iControlPortal.cgi"); 
     $Partition->transport->http_request->header 
       ( 
               'Authorization' =>  
                       'Basic ' . MIME::Base64::encode($user.":".$password, '') 
       );  
      
     my $results = $Partition->set_active_partition( 
       SOAP::Data->name('active_partition')->value(thenameofyourpartition) 
     ); 
     

    Snippet from the Perl Development FAQ in the wiki: Click here
  • I guess I'll have to loop through all available partitions then.

     

    thanks for the pointer.
  • Hello,

    I ended up getting the list of partitions the following way:

    sub getPartition () 
     { 
             my $soapResponse = $Partition->get_partition_list(); 
             &checkResponse($soapResponse); 
             my $plist =  %{$soapResponse}->{'_content'}[4]{'Body'}{'get_partition_listResponse'}{'return'}; 
             return $plist; 
     } 
      
     my $rplist = &getPartition(); 
     if (scalar($rplist) > 1) { 
             foreach my $partition (@$rplist) { 
                     print "Dumping VS Details for partition $partition->{'partition_name'}\n"; 
                     &lookup($partition->{'partition_name'}); 
             } 
     } else { 
             &lookup(); 
     } 
     

    thanks to Data::Dumper to figure the mess out of the structure returned.

    Is there a better way of dealing with the soapresponse, and populate an array of references to the partition hashes?

  • Do we've a similar perl script to pull just list of virtuals with corresponding pools,irules,SSL profiles used on LTM in CSV format if possible.

     

    Software version:- 11.2.1 HF9 ( Any version 11 should be ok )

     

    Please share if you do so.