Forum Discussion

hjb_137394's avatar
hjb_137394
Icon for Nimbostratus rankNimbostratus
May 19, 2014

I want to get the top cpu(us+sy),

I want to get the top cpu(us+sy),which api i can use?

[root@bigip6400-prd-1:Standby] config top top - 14:01:44 up 14 days, 23:59, 1 user, load average: 0.73, 0.88, 0.81 Tasks: 188 total, 1 running, 187 sleeping, 0 stopped, 0 zombie

Cpu(s): 5.6%us, 2.6%sy,
0.0%ni, 91.8%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 8177568k total, 8094360k used, 83208k free, 353576k buffers Swap: 1048504k total, 380k used, 1048124k free, 254628k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

6273 root RT 0 1771m 31m 22m S 7.3 0.4 1420:51 tmm

6272 root RT 0 1771m 31m 22m S 6.3 0.4 1299:24 tmm

2 Replies

  • I'm not sure I understand the question but if you want to gain access to this information via API then take your pick between iControl using SOAP or iControl using REST.

     

  • If I remember correctly, the top command gives you information about the management plane processes, from which tmm is generally the largest consumer. If you want to dig into CPU utilization within tmm, and particularly within each tmm/cpu, then from the command line:

    tmsh show sys cpu
    

    which translates to the following iControlREST syntax:

    curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X GET https://x.x.x.x/mgmt/tm/sys/cpu
    

    You'll need to do some additional parsing to get the User and System values that you're looking for, but the information is all there.