Forum Discussion

BrianW's avatar
BrianW
Icon for Nimbostratus rankNimbostratus
Dec 09, 2014

iControl script to ltm is timing out in 11.6

The following is an excerpt from a script I use to find all of the Virtual Servers and Pools associated to an IP address. I provide the variable $sDestIp and then pull down a list of all Virtual Servers and then check each one for that IP address. Starting when we upgraded to 11.6 it now goes through so many and then times out. We have probably about 600 Virtual Servers and so it makes a call to try to find those IPs for each one. Is there a better way to get he information I require, every Virtual Server associated with an IP address? I didn't see anything like get_vritual_server where you would supply and IP and it would return a Virtual Server Is there something new in 11.6 that would complain about 600 API calls that wasn't there in 11.5?

Here's my perl for what I am doing:

  $soapResponse = $gVirtSrv->get_list();
  &checkResponse($soapResponse);
  @virtSrvs = @{$soapResponse->result};
  VsLoop : {
    foreach $virtSrv (@virtSrvs)
    {
      my $soapResponse = $gVirtSrv->get_destination_v2(SOAP::Data->name(virtual_servers => [$virtSrv]));
      &checkResponse($soapResponse);
      @AddressPortA = @{$soapResponse->result};
      for $i (0 .. $AddressPortA)
      {
        $AddressPortAofA = $AddressPortA[$i];
        $address = $AddressPortAofA->{"address"};
        $port = $AddressPortAofA->{"port"};
        @justAddress = split '/', $address;
        $justAddress2 = $justAddress[2];
        if ( "$justAddress2" eq "$sDestIp" )
        {
          push(@virtServers,"$virtSrv");
        }
      }
    }

1 Reply

  • Why would you make 600 different calls? That is a bit excessive. get_destination_v2 will accept an array of virtual server names and will return all the addresses and port back in the same order it received the names. That way you only make a single call instead of 600 different calls.