Forum Discussion

jcook_105986's avatar
jcook_105986
Icon for Nimbostratus rankNimbostratus
Jun 17, 2008

what error msg is this?

All Im trying to do is, get the following information

 

 

1) CPU 0 usage percentage (in 100%)

 

2) CPU TMM usage percentage (in 100%)

 

3) Momory Usage percentage (used mem / total mem)

 

4) Active Connection (active conn / total conn capa)

 

 

 

In order to do that, Iam trying to use the following

 

codes.

 

 

//////////////////////////////////////////

 

public iControl.Interfaces m_interfaces =

 

new iControl.Interfaces();

 

 

bool conSucess = m_interfaces.initialize ("xxx.xxx.xxx.xxx", "admin", "password");

 

 

//i dont think, this holds the info that i need.

 

iControl.SystemCPUUsageInformation cpu = m_interfaces.SystemSystemInfo.get_cpu_usage_information();

 

 

//I believe this is what i need, but somehow

 

//the code does not work. It compiles alright, but I keep on geting

 

//the runtime err msg (plz refer to the attached img)

 

iControl.SystemCPUUsageExtendedInformation cpuEx=

 

m_interfaces.SystemSystemInfo.get_all_cpu_usage_extended_information();

 

 

//Im not sure where Im going with this.

 

//I just wanted to get some host stat, but I still

 

//get the same runtime err msg as above code.

 

iControl.SystemStatisticsHostStatistics hostStat =

 

m_interfaces.SystemStatistics.get_all_host_statistics();

 

 

//Ok...where can i use this function for?

 

//I mean...all it carry is bunch of strings...and...

 

//what am I suppose to do with these values? iControl.SystemStatisticsPerformanceGraph[] graphInfo =

 

m_interfaces.SystemStatistics.get_performance_graph_list();

 

//////////////////////////////////////////////

 

 

(question -1)

 

In order to get the informaion that I need,

 

which iControl API function should I have a look into?

 

 

(question -2)

 

Why am I getting the runtime error msg? I cannot even catch

 

an exception, becuz iControl even does not throw

 

any exception, but it just rather crash the whole system after that err msg.

4 Replies

  • The error message is just what it says: it can't find the method you requested. What version of BIG-IP are you using? Per the documentation on that API method:

    http://devcentral.f5.com/wiki/default.aspx/iControl/System__SystemInfo__get_all_cpu_usage_extended_information.html

    Click here

    That method was introduced in BIG-IP v9.4.0. If you are using an older version, you cannot make use of that method since it's not on that version.

    Question 2:

    As for exception handling, the calls you are making are straight into the .Net runtime. To catch the exception you need to wrap the calls with a try/catch

    try { 
       m_interfaces.SystemSystemInfo.get_all_cpu_usage_extended_information();  
     }  
     catch (Exception ex) 
     { 
       String sEx = ex.Message.ToString(); 
       // Log or display error here. 
     }

    This same behavior would occur if you tried to use any of the other .Net calls and they return an exception. You have to catch it or it will crash the app.

    -Joe
  • Don_MacVittie_1's avatar
    Don_MacVittie_1
    Historic F5 Account
    For 1, that is the exact error message I get when running against a 9.2 box, if that helps any.

     

     

    Don.
  • Well, that would make since as this method wasn't introduced until BIG-IP v9.4.0.

     

     

    -Joe
  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    Assuming not much changed between 9.2 and 9.3, you'll have to use a mixture of iControl and SNMP to get the detailed stats for the CPU's...

     

     

    FWIW 9.1 didn't allow you to get the detailed stats for either CPU. 9.2/9.3 allows detailed stats via SNMP, but not iControl. As Joe said above, 9.4 allows detailed stats by CPU via iControl.

     

     

    - By detailed stats I mean broken down into user/system/irq/idle not just utilised...