Forum Discussion
Gunasekaran_344
Nimbostratus
Jun 05, 2008LocalLB.PoolMember
I'm a newbie to F5.i am trying to associate a monitor with a PoolMember with the snippet below. It doesn't throw any error, even checked by dumping the response
On verifying from GUI, the monitor is not associated for that poolMember
sub setmonitor {
my ($ip,$port,$pool,$lb);
my $soap = SOAP::Lite
->uri("urn:iControl:LocalLB/PoolMember")
->proxy("https://$lb/iControl/iControlPortal.cgi")|| die "Can't create SOAP object for $lb\n";
my $address_type ="ATYPE_UNSET";
my $ipport = { 'address' => $ip, 'port' => $port };
my $member ={ 'address_type'=>$address_type,'ipport'=>$ipport};
my $monitor_rule={'type' => 'MONITOR_RULE_TYPE_SINGLE', 'quorum' => 0, 'monitor_templates' => ['tcp']};
my $soapResponse = $soap->set_monitor_association(
SOAP::Data->name(pool_names=>[$pool]),
SOAP::Data->name(monitor_associations=> ['{member=>{$member}, {monitor_rule =>$monitor_rule}'] ) );
print "Response", Dumper($soapResponse), "\n";
if ( $soapResponse->fault ) {
print $soapResponse->faultcode;
print $soapResponse->faultstring;
print "ERROR";
}
}
Thanks in advance
-Guna
- This is a common question with dynamic languages. The method for set_monitor_association is
set_monitor_association( in String [] pool_names, in LocalLB__PoolMember__MemberMonitorAssociation [] [] monitor_associations );
set_monitor_association( in String [] pool_names, in LocalLB__PoolMember__MemberMonitorAssociation [] monitor_associations );
... my $monitor_rule={'type' => 'MONITOR_RULE_TYPE_SINGLE', 'quorum' => 0, 'monitor_templates' => ['tcp']}; my $monitor_assoc={'member' => $member, 'monitor_rule' => $monitor_rule} push monitor_assoc_array, $monitor_assoc; push monitor_assoc_AofA, monitor_assoc_array; my $soapResponse = $soap->set_monitor_association( SOAP::Data->name(pool_names => [$pool]), SOAP::Data->name(monitor_associations => [@monitor_assoc_AofA]) );
- Gunasekaran_344
Nimbostratus
Thanks Joe.. - Great!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects