Forum Discussion
Anthony_Gerace_
Feb 22, 2006Historic F5 Account
Unable to find string
Hi,
I'm trying to create a script that will search a class for a given string. No matter what I try I get the string cannot be found. Any suggestions?
Thanks.
Anthony
Here is the basic script and class
class cookieclass {
"172.25.254.220:80-101 test-pool2"
"192.168.254.220:80-101 test-pool"
"192.168.255.220:80-101 test-pool"
}
!c:/perl/bin
Perl Modules used
use SOAP::Lite + trace => qw(method debug);
use SOAP::Lite;
use locale;
-----------------------------------------------------------------------------
Validate Arguments
----------------------------------------------------------------------------
$user = "admin";
$pass = $ARGV[0];
$cName = "cookieclass";
$sHost = "192.168.255.251";
$cRecord = "192.168.255.220:80-101 test-pool";
-----------------------------------------------------------------------------
Main
-----------------------------------------------------------------------------
$soap = SOAP::Lite
-> uri('urn:iControl:LocalLB/Class' )
-> proxy("https://$sHost/iControl/iControlPortal.cgi");
push @entry, $cRecord;
$stringClass->{name} = $cName;
$stringClass->{members} = @entry;
$soap_response = $soap->find_string_class_member(SOAP::Data->name(class_members => [$stringClass]) );
if ( $soap_response->fault) {
print "\n Error: ", $soap_response->faultcode, ", ", $soap_response->faultstring, "\n";
}
else {
@cr = @{$soap_response->result};
@c = $cr[$cName];
$v = $c[$cRecord];
if ($v) {
print "Found!\n";
}
else {
print "Not Found \n";
}
}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