Forum Discussion

Jon_Bartlett_10's avatar
Jon_Bartlett_10
Historic F5 Account
Sep 17, 2008

Virtual Server Connection Limit

I am having some difficulties with trying to get, print and set the connection limit for a Virtual Server. Below is a snippet of where I am at. Any help would be greatly appreciated.

 

 

----------------------------------------------------------------------------

 

get connection limit

 

----------------------------------------------------------------------------

 

sub handle_get()

 

{

 

$soapResponse = $VirtualServer->get_connection_limit

 

(

 

SOAP::Data->name( virtual_servers => [$sVS] )

 

 

);

 

&checkResponse($soapResponse);

 

my @connectionlimit = @{$soapResponse->result};

 

$stat = @connectionlimit;

 

$type = $stat->{"type"};

 

$value = $stat->{"value"};

 

$low = $value->{"low"};

 

$high = $value->{"high"};

 

$value64 = ($high<<32)|$low;

 

print " Virtual Server: $sVS";

 

print " type: $type Connection Limit: $value64\n";

 

 

}

 

 

 

----------------------------------------------------------------------------

 

set connection limit

 

----------------------------------------------------------------------------

 

sub handle_set()

 

{

 

$soapResponse = $VirtualServer->set_connection_limit

 

(

 

SOAP::Data->name( virtual_servers => [$sVS] ),

 

SOAP::Data->name( limits => [$sLimit] )

 

);

 

&checkResponse($soapResponse);

 

}

4 Replies

  • Ask and you shall receive. Here's a little perl app that will query the virtual servers, and get/set the connection limits.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iControl/PerlVirtualServerConnLimit.html

     

    Click here

     

     

     

    The problems I saw in your code is that you weren't accounting for the returned array in the get method and you weren't passing in a ULong64 structure array for the limits parameter in the set method.

     

     

    Hope this helps...

     

     

    -Joe
  • One thing to note about the connection limit. It is limited by a 32bit number so in the "set" method I just set the value as the low 32 bits in the ULong64 structure.

     

     

    Just in case you were wondering B-).

     

     

    -Joe