Forum Discussion
mehdis_60232
Nimbostratus
Jun 19, 2008getting Node statistics : LocalLBNodeAdress.cs (SDK)
Hello,
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.
and the thing is that I just want to display the Node statistics.
methods in localLBAddress.cs:
////////////////////////code//////////////////////
///
[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[ i ].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
- Don_MacVittie_1Historic F5 AccountHi Mehdis,
- mehdis_60232
Nimbostratus
the probleem isn't due to the BIG-IP because the others informations are well displayed.//////////// NodeAddress.LocalLBNodeAddressNodeAddressStatistics statistics = NodeAddress.get_statistics(node_list); for (int i = 0; i < node_list.Length; i++) { NodeAddress.CommonStatistic[] statistic_list = statistics.statistics[ i ].statistics; for (int j = 0; j < statistic_list.Length; j++) { Console.WriteLine(" " + statistic_list[ j ].type.ToString() + " : " + build64(statistic_list[ j ].value)); } }
- Nicolas_Menant
Employee
Hi, - The italics still show up in "code" blocks so it's best to use "[ i ]" in code so it won't transform to a italic html markup.
- mehdis_60232
Nimbostratus
void getNodeInfo(string[] node_list) { // Get Session Status NodeAddress.LocalLBSessionStatus[] session_status_list = NodeAddress.get_session_status(node_list); // Get Enabled State NodeAddress.CommonEnabledState[] enabled_state_list = NodeAddress.get_session_enabled_state(node_list); try { Console.WriteLine("Previous Get Object Status"); // Get Object Status NodeAddress.LocalLBObjectStatus[] object_status_list = NodeAddress.get_object_status(node_list); } catch (Exception ex) { Console.WriteLine(ex.Message.ToString()); Console.WriteLine(ex.ToString()); Console.WriteLine("After Get Object Status"); Console.Read(); } // Get Monitor Status NodeAddress.LocalLBMonitorStatus[] monitor_status_list = NodeAddress.get_monitor_status(node_list); // Get Connection Limit NodeAddress.CommonULong64[] connection_limit_list = NodeAddress.get_connection_limit(node_list); //Get Ratio long[] ratio_list = NodeAddress.get_ratio(node_list); // Get Statistics NodeAddress.LocalLBNodeAddressNodeAddressStatistics statistics = NodeAddress.get_statistics(node_list); for (int i = 0; i < node_list.Length; i++) { Console.WriteLine("NODE " + node_list); Console.WriteLine(" Session Status : " + session_status_list); Console.WriteLine(" Enabled State : " + enabled_state_list); Console.WriteLine(" Monitor Status : " + monitor_status_list); Console.WriteLine(" Availability : " + object_status_list).availability_status); Console.WriteLine(" Connection Limit : " + build64(connection_limit_list)); Console.WriteLine(" Ratio : " + ratio_list); Console.WriteLine(" Statistics :"); 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)); } }
/// [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])); } //////////////////////////////: /// [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 LocalLBObjectStatus[] get_object_status(string[] node_addresses) { object[] results = this.Invoke("get_object_status", new object[] {node_addresses}); return ((LocalLBObjectStatus[])(results[0])); } /// public System.IAsyncResult Beginget_object_status(string[] node_addresses, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("get_object_status", new object[] {node_addresses}, callback, asyncState); } /// public LocalLBObjectStatus[] Endget_object_status(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((LocalLBObjectStatus[])(results[0])); }
- Nicolas_Menant
Employee
Hi,namespace test_ { class Program { static public iControl.Interfaces my_interface; public static UInt64 build64(iControl.CommonULong64 ul64) { return ((UInt64)(UInt32)ul64.high) << 32 | ((UInt64)(UInt32)ul64.low); } static private void print_stats(string[] node_list) { int i, j; iControl.LocalLBNodeAddressNodeAddressStatistics Nodes_stats = my_interface.LocalLBNodeAddress.get_statistics(node_list); for (i = 0; i < node_list.Length; i++) { iControl.LocalLBNodeAddressNodeAddressStatisticEntry Node_stats_entry = Nodes_stats.statistics[ i ]; Console.WriteLine("node: " + Node_stats_entry.node_address ); for (j = 0; j < Node_stats_entry.statistics.Length; j++) { iControl.CommonStatistic Stat = Node_stats_entry.statistics[ j ]; Console.WriteLine("Stats: " + Stat.type.ToString() + ", value -> " + build64(Stat.value).ToString()); } } } static void Main(string[] args) { my_interface = new iControl.Interfaces(); my_interface.initialize("192.168.155.216", "admin", "admin"); if (my_interface.initialized) { print_stats( new string[ ] {"10.1.0.1", "192.168.155.95"} ); } else { Console.WriteLine("Connection failed"); } } } }
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