show processes memory
show processes memory
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show processes memory ",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show processes memory ",
"msg": "Success",
"code": "200",
"body": {
"TABLE_process_memory": {
"ROW_process_memory": [
{
"mem_pid": 1,
"mem_alloc": 188416,
"mem_limit": 0,
"mem_used": 4308992,
"stack_base_ptr": "14203ba0/14203468",
"process": "init"
},
{
"mem_pid": 6036,
"mem_alloc": 2207744,
"mem_limit": 0,
"mem_used": 443641856,
"stack_base_ptr": "ffcf7d90/ffcf7528",
"process": "dcos_sshd"
},
…
…
<snip>
…
…
{
"mem_pid": 28465,
"mem_alloc": 638976,
"mem_limit": 0,
"mem_used": 87199744,
"stack_base_ptr": "e3340940/e333fc38",
"process": "sshd"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show processes memory command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show processes cpu
show processes cpu
import json
"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'
myheaders={'content-type':'application/json'}
payload={
"ins_api":{
"version": "1.0",
"type": "cli_show",
"chunk": "0",
"sid": "1",
"input": "show processes cpu",
"output_format": "json"
}
response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)
{
"ins_api": {
"type": "cli_show",
"version": "1.0",
"sid": "eoc",
"outputs": {
"output": {
"input": "show processes cpu",
"msg": "Success",
"code": "200",
"body": {
"TABLE_process_cpu": {
"ROW_process_cpu": [
{
"pid": 1,
"runtime": 3453,
"invoked": 100181,
"usecs": 34,
"onesec": "0.00",
"process": "init"
},
{
"pid": 6036,
"runtime": 229,
"invoked": 143,
"usecs": 1601,
"onesec": "0.00",
"process": "dcos_sshd"
},
<snip>
{
"pid": 28465,
"runtime": 15,
"invoked": 215,
"usecs": 72,
"onesec": "0.00",
"process": "sshd"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show processes cpu command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|