Forum Discussion
OTS02
Cirrus
Mar 06, 2009set monitor state
I am trying to set a pool member monitor state to disabled. I think that I am very close with this code:
private void SetMonitorState(string pool, string memberaddr, long memberport)
...
Mar 06, 2009
You are close. You haven't allocated a value for the monitor_states[ 0 ][ 0 ] value. This should work for you:
private void SetMonitorState(string pool, string memberaddr, long memberport)
{
string[] pool_names = new string[] { pool };
LocalLBPoolMemberMemberMonitorState[][] monitor_states;
// Allocate a 2-d array
monitor_states = new iControl.LocalLBPoolMemberMemberMonitorState[ 1 ][];
// Allocate the first dimensions value to a 1-d array of size 1
monitor_states[ 0 ] = new iControl.LocalLBPoolMemberMemberMonitorState[ 1 ];
// Allocate the value for the entry in the first element of the second dimension
monitor_states[ 0 ][ 0 ] = new iControl.LocalLBPoolMemberMemberMonitorState();
// Allocate the IPPortDefinition
monitor_states[ 0 ][ 0 ].member = new iControl.CommonIPPortDefinition();
monitor_states[ 0 ][ 0 ].member.address = memberaddr;
monitor_states[ 0 ][ 0 ].member.port = memberport;
monitor_states[ 0 ][ 0 ].monitor_state = CommonEnabledState.STATE_DISABLED;
m_interfaces.LocalLBPoolMember.set_monitor_state(pool_names, monitor_states);
}
BTW, sorry for how the forum munges brackets followed by numbers. I'm going to have to track that down one of these days.
-Joe
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