show rmon alarms
show rmon alarms
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 rmon alarms",
"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 rmon alarms",
"msg": "Success",
"code": "200",
"body": {
"TABLE_rmon_alarm": {
"ROW_rmon_alarm": {
"alaram-str": "Alarm 1 is active, owned by test",
"ascii-buf-str": "Monitors 1.3.6.1.4.1.9.9.305.1.1.1.0 every 30 second(s)",
"samp-type-str": " Taking absolute samples, last value was 7",
"ris-trshod-str": " Rising threshold is 10, assigned to event 1",
"fall-trshod-str": " Falling threshold is 2, assigned to event 2",
"start-enable-str": " On startup enable rising or falling alarm"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon alarms command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show rmon events
show rmon events
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 rmon events",
"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 rmon events",
"msg": "Success",
"code": "200",
"body": {
"TABLE_rmon_event": {
"ROW_rmon_event": [
{
"ev-alaram-str": "Event 1 is active, owned by test",
"ev-desc-str": "Description is cpu_util_raising",
"ev-fir-cause": "log and trap to community public",
"last-fired": "last fired never"
},
{
"ev-alaram-str": "Event 2 is active, owned by test",
"ev-desc-str": "Description is cpu_util_falling",
"ev-fir-cause": "log and trap to community public",
"last-fired": "last fired never"
},
{
"ev-alaram-str": "Event 3 is active, owned by PMON@ERROR",
"ev-desc-str": "Description is ERROR(3)",
"ev-fir-cause": "nothing",
"last-fired": "last fired never"
},
{
"ev-alaram-str": "Event 4 is active, owned by PMON@WARNING",
"ev-desc-str": "Description is WARNING(4)",
"ev-fir-cause": "nothing",
"last-fired": "last fired never"
},
{
"ev-alaram-str": "Event 5 is active, owned by PMON@INFO",
"ev-desc-str": "Description is INFORMATION(5)",
"ev-fir-cause": "nothing",
"last-fired": "last fired never"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon events command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show rmon info
show rmon info
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 rmon info",
"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 rmon info",
"msg": "Success",
"code": "200",
"body": {
"TABLE_rmon_info": {
"ROW_rmon_info": {
"max-32-64-ala-str": "Maximum allowed 32 bit or 64 bit alarms : 512",
"max-conf-32-ala-str": "Number of 32 bit alarms configured : 1",
"max-conf-64-ala-str": "Number of 64 bit hcalarms configured : 0"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon info command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show rmon logs
show rmon logs
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 rmon logs",
"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 rmon logs",
"msg": "Success",
"code": "200",
"body": {
"TABLE_rmon_log": {
"ROW_rmon_log": {
"event-id-str": "Event 1",
"rmon-pch": " 1 cpu_util_raisingRising ",
"log-buff-str": "alarm 1, fired at 2018/07/29-21:04:38 ",
"log-oid": " iso.3.6.1.4.1.9.9.305.1.1.1.0=10 >= 10 "
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show rmon logs command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|