Forum Discussion
Cindy_127211
Nimbostratus
May 26, 2005Setting LocalLB.NodeAddress states
We would like to use the LocalLB method to LocalLB.NodeAddress get_session_status and set_session_enabled_state methods to get the status of a Node and then set the status of the node. However, we have found that with the get_session_status there are (4) different states, while in the GUI there are only (3) and in the set_session_enabled _state there are only (2). How do we set all four states??
LocalLB.get_session_status
SESSION_STATUS_ENABLED0 New sessions are enabled.
SESSION_STATUS_DISABLED1 New sessions are disabled.
SESSION_STATUS_FORCE_DISABLED2 New sessions are forced to disabled
SESSION_STATUS_ADDRESS_DISABLED3 New sessions are disabled on node addresses
LocalLB.set_session_enabled_state
STATE_DISABLED0
STATE_ENABLED1
10 Replies
- Loc_Pham_101863Historic F5 AccountCindy,
Although the mentioned methods sound similar, there are some subtle differences in how they're used.
LocalLB.NodeAddress.set_session_enabled_state
LocalLB.NodeAddress.get_session_enabled_state
The "set" method is used to enable/disable new sessions to be established for the specified node addresses. The "get" method is used to retrieve the value of the configured state that you set with the "set" method.
LocalLB.NodeAddress.get_session_status
This method is used to get the actual, reflected status of the sessions for the specified node addresses. For node addresses, the returned status will likely be either enabled (0), disabled (1), or forced disabled (2). But when you call LocalLB.PoolMember.get_session_status, the returned status also takes into consideration the status of the parent object, (for pool members, the parent objects are the node addresses), hence any of the 4 values is possibly returned.
Now, if you really want to explicitly set the status of the node addresses, or pool members yourself (i.e. bringing them UP or down rather than letting the health monitoring system do it for you), you can override it by calling either
LocalLB.NodeAddress.set_monitor_state or
LocalLB.PoolMember.set_monitor_state
You can then call the "get_monitor_status" in either NodeAddress or PoolMember interface to get the actual, reflected monitor status of the respective objects.
Hope this helps.
Loc - lucien_Caumart2
Nimbostratus
Hello,
I'm looking for the same solution.
Guys, at first, thank you for you help.
But I would like to know where do you catch all of theres iformations concerning LocalLB method.
For resume :
I would like to automatically disable a node when this one goes down.
thank you for you help
Lucien - lucien_Caumart2
Nimbostratus
Hello,
Why ?
Because, I have some manuals modifications before going up the node (file sync) - Hamish_Marson_3
Nimbostratus
Posted By locph on 5/26/2005 2:43:58 PM
Cindy,
Although the mentioned methods sound similar, there are some subtle differences in how they're used.
LocalLB.NodeAddress.set_session_enabled_state
LocalLB.NodeAddress.get_session_enabled_state
The "set" method is used to enable/disable new sessions to be established for the specified node addresses. The "get" method is used to retrieve the value of the configured state that you set with the "set" method.
LocalLB.NodeAddress.get_session_status
This method is used to get the actual, reflected status of the sessions for the specified node addresses. For node addresses, the returned status will likely be either enabled (0), disabled (1), or forced disabled (2). But when you call LocalLB.PoolMember.get_session_status, the returned status also takes into consideration the status of the parent object, (for pool members, the parent objects are the node addresses), hence any of the 4 values is possibly returned.
Now, if you really want to explicitly set the status of the node addresses, or pool members yourself (i.e. bringing them UP or down rather than letting the health monitoring system do it for you), you can override it by calling either
LocalLB.NodeAddress.set_monitor_state or
LocalLB.PoolMember.set_monitor_state
You can then call the "get_monitor_status" in either NodeAddress or PoolMember interface to get the actual, reflected monitor status of the respective objects.
Hope this helps.
Loc
Is there any way to do the equivalent of the v4.5 forced down of a pool member?
With v9 it appears to be possible to disable sessions. But leave connections alone for a pool member. And to disable a nodeaddress entirely (i.e. all ports). But can I disable a nodeaddress:port only?
I understand you can doit by over-riding the monitor & setting the monitored state to down, but does this then get over-written itself when the monitor next runs & get set back up again?
I ask because we have multiple services on the same box, just running on different ports. If I want to disable the node it looks like I can only disable new sessions (By poolmember node:port), or disable ALL the services on a nodeaddress, or disable temporarily until the monitor runs again...
Or have I missed something?
TIA - With the move to the new 9.0 architecture, a node server (ip:port) is no longer a high level object. The only existence of a node ip:port is within the context of a pool. We call these Pool Members.
This topic has been covered on this forum thread:
http://devcentral.f5.com/default.aspx?tabid=53&view=topic&forumid=3&postid=3013
Click here
By your comment about temporarily disabling the pool member until the monitor runs again, I believe that this call is persistent. If you set the monitor_state to down then it will force down the member until you explicitly enable it again.
So, I think the answer to your question is to use the set_monitor_status() method. Keep in mind that if you have the same ip:port configuration setup within multiple pools, you will have to disable it within the context of each of the pools.
-Joe - Hamish_Marson_3
Nimbostratus
Do I have old docs? Or am I reading them wrong? My current iControl SDK v9.0 says that "set_monitor_state" enables & disables the monitoring of a node (Or nodeaddress)...
It says nothing about affecting current connections across a node or nodeaddress. - Looks like the docs need updating if this isn't clear. The monitor_state is an overridden property. If you set it to disabled then it will be marked down and health monitoring won't happen until you bring it back up again.
-Joe - Hamish_Marson_3
Nimbostratus
Posted By Joe on 8/19/2005 8:33:55 AM
Looks like the docs need updating if this isn't clear. The monitor_state is an overridden property. If you set it to disabled then it will be marked down and health monitoring won't happen until you bring it back up again.
-Joe
OK. Cheers for that.
Should I raise a support call to get the docs fixed, or will you take care of that anyway?
The docs just say...
Method set_monitor_state
Introduced : BIG-IP_v9.0
Sets the monitor states for the specified pool members. If monitor state is enabled or true, this means that the associated member will be monitored based on the monitor rule specified in its parent pool. If disabled or false, then the associated member will not be monitored.
TIA
Hamish. - I'll make the change in the docs for the next release.
-Joe - mehdis_60232
Nimbostratus
Hello,you have to know well this class , and i have i problem.
in NodeAdressmain.cs i can't use those two methods:
-get_object_status
-get_statistics
When i try to use it, i have the exeption :
exeption caught in LocalLB::urn:iControl:LocalLB/NodeAddress::get_statistics()
Eception : Common : OperationFailed
primary_error_code : 17238054
secondary_error_code : 0
error_string : 01070826:3: current Update Partition Error ...
I have the same thing for get_object status.
I just want to display the Node statistics.
methods in localLBAddress.cs(samples SDK):
///
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:LocalLB/NodeAddress",
RequestNamespace="urn:iControl:LocalLB/NodeAddress", ResponseNamespace="urn:iControl:LocalLB/NodeAddress")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public LocalLBNodeAddressNodeAddressStatistics get_all_statistics()
{ object[] results = this.Invoke("get_all_statistics", new object[0]);
return ((LocalLBNodeAddressNodeAddressStatistics)(results[0]));
}
///
public System.IAsyncResult Beginget_all_statistics(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("get_all_statistics", new object[0], callback, asyncState);
}
///
public LocalLBNodeAddressNodeAddressStatistics Endget_all_statistics(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((LocalLBNodeAddressNodeAddressStatistics)(results[0]));
}
In NodeAdressMain:
// Get Statistics
NodeAddress.LocalLBNodeAddressNodeAddressStatistics statistics =
NodeAddress.get_statistics(node_list);
NodeAddress.CommonStatistic[] statistic_list = statistics.statistics.statistics;
for (int j = 0; j < statistic_list.Length; j++)
{
Console.WriteLine(
statistic_list[j].type.ToString() + " : " + build64(statistic_list[j].value)
);
}
Plz i need some help and i'm a begginer in c
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
