Forum Discussion
Problem with Statistics
Hi,
I want to retrieve the information of the performance below Overview in the web, such as Memory Used, System CPU Usage, Active Connections, New Connections, etc..
I'm using iControl API in C application. My BIG-IP's version is "10.1.0.3341.1084".
I want to use System/Statistics->get_performance_graph_list and get_performance_table_list to retrieve the information, but I always get the wrong message "Something is wrong in XML document(11, 2)". I don't know why.
Is the way I had found right? If I did it in a wrong way, how can I retrieve the information of the performance? Thank you!
Following is the class I wrote several days before.
namespace Statistics{
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
///
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="System.StatisticsBinding", Namespace="urn:iControl")]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(PerformanceGraph))]
[System.Xml.Serialization.SoapIncludeAttribute(typeof(PerformanceTable))]
public class SystemStatistics : System.Web.Services.Protocols.SoapHttpClientProtocol
{
///
public SystemStatistics() {
this.Url = "";
}
///
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:System/Statistics", RequestNamespace="urn:iControl:System/Statistics", ResponseNamespace="urn:iControl:System/Statistics")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public PerformanceGraph[] get_performance_graph_list() {
object[] results = this.Invoke("get_performance_graph_list", new object[0]);
return ((PerformanceGraph[])(results[0]));
}
///
public System.IAsyncResult Beginget_performance_graph_list(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("get_performance_graph_list", new object[0], callback, asyncState);
}
///
public PerformanceGraph[] Endget_performance_graph_list(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((PerformanceGraph[])(results[0]));
}
///
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:System/Statistics", RequestNamespace = "urn:iControl:System/Statistics", ResponseNamespace = "urn:iControl:System/Statistics")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public PerformanceTable[] get_performance_table_list()
{
object[] results = this.Invoke("get_performance_table_list", new object[0]);
return ((PerformanceTable[])(results[0]));
}
///
public System.IAsyncResult Beginget_performance_table_list(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("get_performance_table_list", new object[0], callback, asyncState);
}
///
public PerformanceTable[] Endget_performance_table_list(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((PerformanceTable[])(results[0]));
}
///
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:System/Statistics", RequestNamespace = "urn:iControl:System/Statistics", ResponseNamespace = "urn:iControl:System/Statistics")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public string[] get_list_of_hosts()
{
object[] results = this.Invoke("get_list_of_hosts", new object[0]);
return ((string[])(results[0]));
}
///
public System.IAsyncResult Beginget_list_of_hosts(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("get_list_of_hosts", new object[0], callback, asyncState);
}
///
public string[] Endget_list_of_hosts(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((string[])(results[0]));
}
///
[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:System/Statistics", RequestNamespace = "urn:iControl:System/Statistics", ResponseNamespace = "urn:iControl:System/Statistics")]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public string get_version()
{
object[] results = this.Invoke("get_version", new object[0]);
return ((string)(results[0]));
}
///
public System.IAsyncResult Beginget_version(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("get_version", new object[0], callback, asyncState);
}
///
public string Endget_version(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}
public class PerformanceGraph
{
public string graph_name; //The key or name of the graph
public string graph_title; //The title of the graph as appeared in the GUI's Performance Graph
public string graph_description; //The text description of this graph
};
public class PerformanceTable
{
public string table_name; //The key or name of the table.
public string table_description; //String The text description of this table.
};
}
- samstep
Cirrocumulus
- Did you compile the WSDL yourself and incorporate it into your application? If so, I'd recommend going with the iControl Assembly. Just plug the .Net assembly into your project and you don't have to muck around with all the lower level bindings. You can find that download in the iControl Assembly Labs project under the Download menu.
- lisanwan_54895
Nimbostratus
Posted By Joe on 07/21/2010 12:01 PM - lisanwan_54895
Nimbostratus
Thanks to everyone who had read my topic. - You still shouldn't have to be defining the classes yourself. The SDK is a bit out of date with regards to the .Net samples. For future development, we have provided a .Net assembly with all the iControl interfaces and objects bundled up for you. Go to the Download.Labs page and select the iControl Assembly. By clicking on the "Discussions and Downloads" link you can get the iControl Assembly for .Net. In your VS.Net project, just select "Add Reference" and point it to the downloaded iControl.dll and you can access all the iControl interfaces and methods from a newly instantiated iControl.Interfaces object. The code looks something like this
iControl.Interfaces interfaces = new iControl.Interfaces(); interfaces.initialize("bigip_addr", "username", "password"); string [] vip_list = interfaces.LocalLBVirtualServer.get_list();
- lisanwan_54895
Nimbostratus
Thank you, Joe
Recent Discussions
Related Content
* 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