Forum Discussion
wayney_128269
Nimbostratus
Aug 18, 2005example of a call to PoolMember.set_monitor_state
I cannot find any sample C code in the SDK that does a call to PoolMember.set_monitor_state. Can someone send me some sample c code that makes this call?
thanks
wayne
13 Replies
- wayney_128269
Nimbostratus
Has anyone at F5 had a chance to look into my request for sample c code that calls PoolMember.set_monitor_state?
thanks - wayney_128269
Nimbostratus
Hello, Anybody at F5 moniting these forums? I need some assistance - wayney_128269
Nimbostratus
So I tried calling PoolMember.set_monitor_state to perform and UP\DOWN. Looking at the logs it appears the BIGIP is doing something as the monitor_state value is changing. What call should I make to retrieve poolMemeber monitor status?
thanks
log:
Thu Aug 25 18:40:11 PDT 2005
admin
93379-1
POOL_MEMBER modified:
pool_name="pool100"
addr=10.10.10.11
port=http
monitor_state=2
Thu Aug 25 18:39:20 PDT 2005
admin
92384-1
POOL_MEMBER modified:
pool_name="pool100"
addr=10.10.10.11
port=http
monitor_state=7 - How about PoolMember::get_monitor_state()...
-Joe - Loc_Pham_101863Historic F5 AccountActually, use LocalLB::PoolMember::get_monitor_status
Loc - wayney_128269
Nimbostratus
ok which one should it be? PoolMember.set_monitor_state or PoolMember::get_monitor_status and what is the difference? - Trust Loc, he wrote the code...
-Joe - Loc_Pham_101863Historic F5 AccountThere's no get_monitor_state, just get_monitor_status.
Loc - wayney_128269
Nimbostratus
ok, so I'm getting an error from out BIGIP box when I try to manage DIPs from 2 different pools. It cannot seem to find one of the pools. If I try to manage multiple DIPs within the *same* pool, everything works fine. Its just when I try to manage DIPs from multiple pools that I get this error:
Exception caught in LocalLB::PoolMember::set_monitor_state()
Exception: Common::OperationFailed
primary_error_code : 16908342 (0x01020036)
secondary_error_code : 0
error_string : 01020036:3: The requested pool member (pool101 10
.10.10.12 http) was not found. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie
ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCal
l)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame, Object[] parameters)
at PoolMember.LocalLBPoolMember.set_monitor_state(String[] pool_names, LocalL
BPoolMemberMemberMonitorState[][] monitor_states)
at Pool.Class1.setPoolInfo(String[] pool_name)
Here is the code:
PoolMember.LocalLBPoolMemberMemberMonitorState[][] monitor_states = new PoolMember.LocalLBPoolMemberMemberMonitorState[1][];
monitor_states[0] = new PoolMember.LocalLBPoolMemberMemberMonitorState[2];
String [] pool_names = new String[] { "pool101","pool100" };
monitor_states[0][0] = new PoolMember.LocalLBPoolMemberMemberMonitorState();
monitor_states[0][0].member = new PoolMember.CommonIPPortDefinition();
monitor_states[0][0].member.address = "10.10.10.12";
monitor_states[0][0].member.port = 443;
monitor_states[0][0].monitor_state = PoolMember.CommonEnabledState.STATE_DISABLED;
//
monitor_states[0][1] = new PoolMember.LocalLBPoolMemberMemberMonitorState();
monitor_states[0][1].member = new PoolMember.CommonIPPortDefinition();
monitor_states[0][1].member.address = "10.10.10.12";
monitor_states[0][1].member.port = 80;
monitor_states[0][1].monitor_state = PoolMember.CommonEnabledState.STATE_DISABLED;
PoolMember2.set_monitor_state(pool_names, monitor_states);
Exception caught in LocalLB::PoolMember::set_monitor_state()
Exception: Common::OperationFailed
primary_error_code : 16908342 (0x01020036)
secondary_error_code : 0
error_string : 01020036:3: The requested pool member (pool101 10
.10.10.12 http) was not found. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie
ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCal
l)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame, Object[] parameters)
at PoolMember.LocalLBPoolMember.set_monitor_state(String[] pool_names, LocalL
BPoolMemberMemberMonitorState[][] monitor_states)
at Pool.Class1.setPoolInfo(String[] pool_name)
thanks
wayne - Wayne,
What is your configuration? The code looks odd as you are passing in two pools in the first parameter, but not sending in any monitor_states for the second pool.
ie.
+pool101
|-- 10.10.10.12:443 (DISABLED)
|-- 10.10.10.12:80 (DISABLED)
+pool100
Is the node listening on 80 in your pool101? That is what it seems the error is indicating? The reason why I'm confused is that you specified in the post that you were trying to manage two pools when this error occurred.
If the 80 node is in the second pool, you need to add that monitor state to the second entry in the first dimension of the array:String [] pool_names = new String[] { "pool101","pool100" }; PoolMember.LocalLBPoolMemberMemberMonitorState[][] monitor_states = new PoolMember.LocalLBPoolMemberMemberMonitorState[2][]; // For pool pool101 monitor_states[0] = new PoolMember.LocalLBPoolMemberMemberMonitorState[1]; monitor_states[0][0] = new PoolMember.LocalLBPoolMemberMemberMonitorState(); monitor_states[0][0].member = new PoolMember.CommonIPPortDefinition(); monitor_states[0][0].member.address = "10.10.10.12"; monitor_states[0][0].member.port = 443; monitor_states[0][0].monitor_state = PoolMember.CommonEnabledState.STATE_DISABLED; // For pool pool100 monitor_states[1] = new PoolMember.LocalLBPoolMemberMemberMonitorState[1]; monitor_states[1][0] = new PoolMember.LocalLBPoolMemberMemberMonitorState(); monitor_states[1][0].member = new PoolMember.CommonIPPortDefinition(); monitor_states[1][0].member.address = "10.10.10.12"; monitor_states[1][0].member.port = 80; monitor_states[1][0].monitor_state = PoolMember.CommonEnabledState.STATE_DISABLED; PoolMember2.set_monitor_state(pool_names, monitor_states);
This will send the following:
+pool101
|-- 10.10.10.12:443 (DISABLED)
+pool100
|-- 10.10.10.12:80 (DISABLED)
Which is what I think you are trying to do? Correct me if I've got it wrong.
-Joe
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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