Forum Discussion

mehdis_60232's avatar
mehdis_60232
Icon for Nimbostratus rankNimbostratus
Jun 19, 2008

getting 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

6 Replies

  • Don_MacVittie_1's avatar
    Don_MacVittie_1
    Historic F5 Account
    Hi Mehdis,

     

     

    I have not seen this error before. If you're using partitions, check out Joe's excellent partition overview of partitions here: http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=176

     

     

    If you are not using partitions, I suspect that the BIG-IP you're accessing failed in a software update and that's what's causing your problem - do you have another BIG-IP you can test against?

     

     

    Regards,

     

    Don.
  • the probleem isn't due to the BIG-IP because the others informations are well displayed.

    for example:

    SESSION_STATUS_ENABLED

    MONITOR_STATUS_UNCHEKED

    Connection limit,ratio

    ...

    I have just this exeption when i want to use "get_statistics" .Yes i'm using partitions(is it an other way tro proceed?)Perhaps it's just comming from the syntax :

    ////////////  
     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));  
          }  
     }

    PS: Thx for your help and excuse my english. i'm french

  • Hi,

     

     

    Since your code is using the italic command ([ i ])your code is all messed up.

     

     

    Can you embrace your code with those sign: [ code ] [ / code ] (remove the space)

     

     

    This way your code should be ok to read!

     

     

    Thanks
  • 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.

     

     

    -Joe
  • 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)); } }

     

     

     

     

    LocalLBNodeAdress :

     

    /// [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])); }
  • Hi,

     

     

    I tried a simple code and it seems ok (i use 9.4.4):

     

     

      
      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");  
                  }  
              }  
          }  
      }