Forum Discussion
Carl_69698
Nimbostratus
Nov 16, 2009iControl PoolMember Status (available or offline) via Java API
Hi,
I have a BIG-IP Local Traffic manager with a specific pool and 2 members. Each member has a heart beat mechanism and if the specified heartbeat returns something other than a value of "ACTIVE" then its status becomes Offline and vise versa. I am using the following code to query the BIG-IP local Traffic manager and it is not giving the proper status back. The BIG-IP console correctly shows if the status of on of the members is available or offline. I am trying to use the iControlAPI to query the status of one of the Pool members and get the correct status of available or offline. I am using the following code and it is not able to retrieve this status properly:
public class iControlStatus {
public static void main(String[] args) {
String[] chudPoolList = new String[1];
chudPoolList[0] = "drt00das.pjm.com";
try {
Interfaces myi = new Interfaces();
myi.initialize("ip_address",
"user_name",
"password");
LocalLBPoolPortType t =
myi.getLocalLBPool();
LocalLBPoolMemberPortType poolMember = myi.getLocalLBPoolMember();
LocalLBPoolMemberMemberSessionStatus[][] sessionStatus = poolMember.get_session_status(chudPoolList);
for (int h=0; h
for (int i=0; i
LocalLBPoolMemberMemberSessionStatus status = sessionStatus[h];
CommonIPPortDefinition member = status.getMember();
System.out.println("Member Address: " + member.getAddress());
LocalLBSessionStatus memberStatus = status.getSession_status();
System.out.println("Member Status: " + memberStatus.getValue());
}
}
}
catch (Exception e) {
System.out.println(" **** ERROR ****: " + e.getMessage());
e.printStackTrace();
}
}
}
This produces the following:
Member Address: ip_address_1
Member Status: SESSION_STATUS_ENABLED
Member Address: ip_address_2
Member Status: SESSION_STATUS_DISABLED
Looking at the console it is showing that ip_address_1 is offline and that ip_address_2 is available. I have not been able to find an API that will give me the proper status that will tell me if this member is currently available or offline.
Your help is greatly appreciated!
Many Thanks!
Carl
- Carl_69698
Nimbostratus
I was able to get this working. Here is the code:
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