Forum Discussion
jajamax_127538
Nimbostratus
Dec 03, 2003modify the LocalLBNode script???
I've got the LocalLBNode.pl working, but I'd like it to do more. Can anyone help with an "IF like" statement? What I'm wanting is basically this:
If node is enabled, then disable
If no...
Jan 22, 2004
Here's a sample app you can run to query the failover state of the BIG-IP (Active or Standby). Let me know if this helps.
-Joe
use SOAP::Lite;
----------------------------------------------------------------------------
Validate Arguments
----------------------------------------------------------------------------
my $sHost = $ARGV[0];
my $sPort = $ARGV[1];
my $sUID = $ARGV[2];
my $sPWD = $ARGV[3];
my $sProtocol = "https";
if ( ("80" eq $sPort) or ("8080" eq $sPort) )
{
$sProtocol = "http";
}
sub usage()
{
die ("Usage: LocalLBFailover.pl host port uid pwd \n");
}
if ( ($sHost eq "") or ($sPort eq "") or ($sUID eq "") or ($sPWD eq "") )
{
usage();
}
----------------------------------------------------------------------------
Transport Information
----------------------------------------------------------------------------
sub SOAP::Transport::HTTP::Client::get_basic_credentials
{
return "$sUID" => "$sPWD";
}
$soap = SOAP::Lite
-> uri('urn:iControl:ITCMLocalLB/Failover')
-> readable(1)
-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");
&queryFailoverState();
sub queryFailoverState()
{
$soapResponse = $soap->get_failover_state();
if ( $soapResponse->fault )
{
print $soap_response->faultcode, "(faultstring) ", $soap_response->faultstring, "\n";
print $soap_response->faultcode, "(faultdetail) ", $soap_response->faultdetail, "\n";
}
else
{
$state = $soapResponse->result;
print "Failover state: ";
if ( 0 == $state )
{
print "STANDBY\n";
}
else
{
print "ACTIVE\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