Forum Discussion
iControl - getting Redundancy State Preference
Hi
I need to check if "Redundancy State Preference" value is "Active" or "Standby" with my Java iControl application.
I could find two functions almost close to that purpose. System.Failover.get_failover_mode() and System.Failover.get_failover_state(). But they don't fit my need exactly.
Is there any function to get failover state preference? Maybe something like System.Failover.get_failover_preference() ?
Please help.
2 Replies
- Faintly_Lucky
Nimbostratus
Hey there:
What I do is query the Database directly for that. I can't help with Java, but I can give you a perl example that maybe you can translate.
$db = SOAP::Lite
-> uri('urn:iControl:Management/DBVariable')
-> readable(1)
-> proxy("https://$sHost/iControl/iControlPortal.cgi");
eval {
$db->transport->http_request->header( 'Authorization' => 'Basic '
. MIME::Base64::encode("$sUID:$sPWD", ''));
};
$soapresponse = $db->query(
SOAP::Data->name ( variables => ["Failover.ForceStandby","Failover.ForceActive"] ),
);
&checkresponse($soapresponse);
@dbva = @{$soapresponse->result};
print "\n";
foreach $dbvar ( @dbva ) {
$varname = $dbvar->{"name"};
$valdata = $dbvar->{"value"};
print "$varname $valdata\n";
}
If you're looking to set them (I always disable redundancy state preference):
Note: F5 recommends the None setting, as it gives you time to investigate why the primary unit failed over, and to assess whether this may happen again. If you select None, you can avoid further failovers if unit1 runs into the same issue multiple times.
$vval1 =
{
name => "Failover.ForceStandby",
value => "disable"
};
$vval2 =
{
name => "Failover.ForceActive",
value => "disable"
};
push @vvaldata,$vval1;
push @vvaldata,$vval2;
$soapresponse = $db->modify(
SOAP::Data->name ( variables => [@vvaldata] ),
);
Hope that this helps.
Chris - ykkim
Nimbostratus
Hi Lucky,
Your reply was very helpful.
I could get what I wanted by following your advice. I called Java iControl function ...getManagementDBVariable().query(....).
Thanks.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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