Forum Discussion
Jay_Nielson_410
Mar 16, 2012Nimbostratus
.Net Monitoring throughput Suggestions needed
I think I have the pertenant code below and the error message it generates is on .get_performance_graph_csv_statistics(Query). I have tried various valid performance graph name "memory", "CPU" and "throughput" and a few other permutations of code but I always get hung up with this error. I was starting by trying to pull raw data from the LBs to be stored on a web server. Any suggestions?
iControl.Interfaces interfaces = new iControl.Interfaces(); if (interfaces.initialize(selfip.ToString(), 443, "xxxxx", "xxxxxxx")) { iControl.SystemStatisticsPerformanceGraph[] graphInfo = interfaces.SystemStatistics.get_performance_graph_list(); for (int i = 0; i "); } iControl.SystemStatisticsPerformanceStatisticQuery[] Query = new iControl.SystemStatisticsPerformanceStatisticQuery[5]; Query[0] = new iControl.SystemStatisticsPerformanceStatisticQuery(); // <-- Added this to create the first object. Query[0].object_name = "memory"; Query[0].start_time = 0; Query[0].end_time = 0; Query[0].interval = 0; Query[0].maximum_rows = 0; interfaces.SystemStatistics.get_performance_graph_csv_statistics(Query); }
=======================
Server Error in '/bigiplb' Application.
--------------------------------------------------------------------------------
Could not find element by name: object_name
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Services.Protocols.SoapHeaderException: Could not find element by name: object_name Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack
Trace: [SoapHeaderException: Could not find element by name: object_name] System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +431766 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +204 iControl.SystemStatistics.get_performance_graph_csv_statistics(SystemStatisticsPerformanceStatisticQuery[] objects) +107 icontrol_1.Throughput.Button1_Click(Object sender, EventArgs e) in D:\Documents and Settings\jay.nielson\My Documents\Visual Studio 2005\Projects\icontrol_1\icontrol_1\Throughput.aspx.cs:79 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634
- Could it be that you are allocating an array of size '5' for the Query parameter but are only allocating and filling the structure in the first element?
- BTW, here's a tech tip I wrote a while back on the performance statistics methods:
- Jay_Nielson_410NimbostratusYes that tech tip is what I started with when I was researching this. Unfortunatley, I don't think powershell is allowed on the network I am working on. I have reviewed many articles and got the impression it was query[0] all the way down. Most of the ways I have changed it make it not compile, not sure what I am missing but I do think it is Query definition if its a code issue at all
- Jay_Nielson_410NimbostratusThat seems to get me past my issue, I could have sworn I tried that several times. Oh well I'll add the valuable stuff to this post after I get it done.
- I just tested out the code by setting the array size to 1 instead of 5 and it works for me. Here's something that should get you going:
void getPerformanceGraphCSV() { iControl.SystemStatisticsPerformanceGraph[] graph_list = m_interfaces.SystemStatistics.get_performance_graph_list(); for(int i=0; i < graph_list.Length; i++) { iControl.SystemStatisticsPerformanceStatisticQuery[] queries = new iControl.SystemStatisticsPerformanceStatisticQuery[1]; queries[0] = new iControl.SystemStatisticsPerformanceStatisticQuery(); queries[0].object_name = graph_list[ i ].graph_name; queries[0].start_time = 0; queries[0].end_time = 0; queries[0].interval = 0; queries[0].maximum_rows = 0; iControl.SystemStatisticsPerformanceGraphDataCSV[] graph_dataA = m_interfaces.SystemStatistics.get_performance_graph_csv_statistics(queries); for (int j = 0; j < graph_dataA.Length; j++) { Console.WriteLine("--------------------------------------------------"); Console.WriteLine("Graph : " + graph_dataA[j].object_name); Console.WriteLine("Start Time : " + graph_dataA[j].start_time); Console.WriteLine("End Time : " + graph_dataA[j].end_time); Console.WriteLine("Interval : " + graph_dataA[j].interval); Console.WriteLine("--------------------------------------------------"); String csv_data = System.Text.Encoding.ASCII.GetString(graph_dataA[j].statistic_data); Console.WriteLine(csv_data); } } }
- In this example, I broke the call apart to only call get_performance_graph_csv_data once for each graph, but you could combine them all in a single query if you want to eliminate multiple calls.
- Jay_Nielson_410NimbostratusYes the 5 to 1 change worked for me as well. I don't know how I overlooked that, but it definitely gets me goin good now.
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