CPU Utilization

Import OPBNOS API

from opbclient import opb_api as opbapi

Initialize client

Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

node = opbapi.connect_to('SN2010')

Get/Show CPU Utilization

Retrieves system CPU utilization

node.execute(['show cpu util'])

Output

This is an example of the output of the above command:

b'{"%CPU_Util": "14.249999999999998"}'

The below table lists and describes input and output attributes:

Attribute Values Description
"CPU_Util" float indicates average CPU usage

Note: Output of the API

API will not produce any output unless the below status code in produced, indicating a server error.

Status : 500 -> Response : b'500'