Forum Discussion

bentuteh_340831's avatar
bentuteh_340831
Icon for Nimbostratus rankNimbostratus
Feb 12, 2018
Solved

Device Level Statistics on iControlREST

I am attempting to scrape current F5 Device level statistics for CPU, Memory, etc, from an API to instrument into a monitoring system. I see on the GUI dashboard for my F5 device under statistics ==> performance, but is it possible to pull this information from API? I'm not seeing any promising leads so far in the API documentation, but I also don't know my way around the API particularly well yet. Any insight or guidance would be very appreciated. Thanks!

 

  • So I found a few endpoints that can be queried via iControl REST API for these:

    /mgmt/tm/sys/cpu
    /mgmt/tm/sys/memory
    

    Though undocumented, these provide the device-level stats that I was looking for via REST API. Recursion was very helpful in parsing this data as well.

5 Replies

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus

    SNMP is probably the easiest method to pull stats. And in theory should be more efficient.

     

    There should still be a few examples sprinkled around devcentral. Plus some cacti templates as well.

     

    The SNMP MIBs are available from the GUI.

     

  • So I found a few endpoints that can be queried via iControl REST API for these:

    /mgmt/tm/sys/cpu
    /mgmt/tm/sys/memory
    

    Though undocumented, these provide the device-level stats that I was looking for via REST API. Recursion was very helpful in parsing this data as well.

  • I know this is 3 years old but it is an excellent post.

     

    Do you have a curl example on how to hit these api endpoints in this format?

     

    https://support.f5.com/csp/article/K17283308

     

    If not I'll try and find it and post back.

  • https://devcentral.f5.com/s/question/0D51T00007BHjOt/collecting-memory-statistics-via-api-icontrol

    1. curl -sk -u admin -H "Content-Type: application/json" -X GET https://<hostname>/mgmt/tm/sys/memory | jq/jq