show snmp
show snmp
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 snmp",
"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 snmp",
"msg": "Success",
"code": "200",
"body": {
"sys_contact": "",
"sys_location": "",
"snmp_input_packets": "3 SNMP packets input",
"bad_snmp_version": " 0 Bad SNMP versions",
"unknown_community_name": " 0 Unknown community name",
"illegal_community_name": " 0 Illegal operation for community name supplied",
"encoding_Err": " 0 Encoding errors",
"req_var_nums": " 3 Number of requested variables",
"alt_var_nums": " 0 Number of altered variables",
"get_req_in": " 0 Get-request PDUs",
"getnext_req_in": " 2 Get-next PDUs",
"set_req_in": " 0 Set-request PDUs",
"noname_pdu_in": " 0 No such name PDU",
"badval_pdu_in": " 0 Bad value PDU",
"ro_pdu_in": " 0 Read Only PDU",
"genral_err_in": " 0 General errors",
"get_resp_in": " 0 Get Responses",
"unknown_ctx": " 0 Unknown Context name",
"snmp_output_packets": "155 SNMP packets output",
"trap_pdu": " 152 Trap PDU",
"toobig_err": " 0 Too big errors (Maximum packet size 1500)",
"noname_pdu_out": " 0 No such name errors",
"badval_pdu_out": " 0 Bad values errors",
"genral_err_out": " 0 General errors",
"get_req_out": " 0 Get Requests",
"getnext_req_out": " 0 Get Next Requests",
"set_req_out": " 0 Set Requests",
"get_resp_out": " 3 Get Responses",
"silent_drops": " 0 Silent drops",
"max_pkt_size": "Max packetsize: 1500",
"tcp_auth_status": "SNMP Tcp Authentication Flag : Enabled.",
"protocol_status": "SNMP protocol : Enabled",
"TABLE_snmp_users": {
"ROW_snmp_users": [
{
"user": "test ",
"auth": "md5 ",
"priv": "des(no) ",
"TABLE_groups": {
"ROW_groups": {
"group": "network-operator "
}
}
},
{
"user": "admin ",
"auth": "md5 ",
"priv": "des(no) ",
"TABLE_groups": {
"ROW_groups": {
"group": "network-admin "
}
}
}
]
},
"TABLE_snmp_community": {
"ROW_snmp_community": {
"community_name": "public",
"grouporaccess": "network-operator ",
"context": "",
"aclfilter": ""
}
},
"TABLE_snmp_contexts": {
"ROW_snmp_contexts": [
{
"context_name": "1",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "1"
},
{
"context_name": "2",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "2"
},
{
"context_name": "3",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "3"
},
{
"context_name": "4",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "4"
},
{
"context_name": "5",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "5"
},
{
"context_name": "6",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "6"
},
{
"context_name": "7",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "7"
},
{
"context_name": "8",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "8"
},
{
"context_name": "9",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "9"
},
{
"context_name": "10",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "10"
},
{
"context_name": "vlan-1",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "1"
},
{
"context_name": "vlan-2",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "2"
},
{
"context_name": "vlan-3",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "3"
},
{
"context_name": "vlan-4",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "4"
},
{
"context_name": "vlan-5",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "5"
},
{
"context_name": "vlan-6",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "6"
},
{
"context_name": "vlan-7",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "7"
},
{
"context_name": "vlan-8",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "8"
},
{
"context_name": "vlan-9",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "9"
},
{
"context_name": "vlan-10",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "10"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp community
show snmp community
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 snmp community",
"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 snmp community",
"msg": "Success",
"code": "200",
"body": {
"TABLE_snmp_community": {
"ROW_snmp_community": {
"community_name": "public",
"grouporaccess": "network-operator ",
"context": "",
"aclfilter": ""
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp community command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp context
show snmp context
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 snmp context",
"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 snmp context",
"msg": "Success",
"code": "200",
"body": {
"TABLE_snmp_contexts": {
"ROW_snmp_contexts": [
{
"context_name": "1",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "1"
},
{
"context_name": "2",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "2"
},
{
"context_name": "3",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "3"
},
{
"context_name": "4",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "4"
},
{
"context_name": "5",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "5"
},
{
"context_name": "6",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "6"
},
{
"context_name": "7",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "7"
},
{
"context_name": "8",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "8"
},
{
"context_name": "9",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "9"
},
{
"context_name": "10",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "10"
},
{
"context_name": "vlan-1",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "1"
},
{
"context_name": "vlan-2",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "2"
},
{
"context_name": "vlan-3",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "3"
},
{
"context_name": "vlan-4",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "4"
},
{
"context_name": "vlan-5",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "5"
},
{
"context_name": "vlan-6",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "6"
},
{
"context_name": "vlan-7",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "7"
},
{
"context_name": "vlan-8",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "8"
},
{
"context_name": "vlan-9",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "9"
},
{
"context_name": "vlan-10",
"proto_instanceid": "",
"vrf": "",
"topology": "",
"vlan": "10"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp context command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp engineID
show snmp engineID
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 snmp engineID",
"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 snmp engineID",
"msg": "Success",
"code": "200",
"body": {
"engineIDHex": "800000090300F28B7A96E6",
"engineIDDec": "128:000:000:009:003:000:242:139:122:150:230"
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp engineID command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp group
show snmp group
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 snmp group",
"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 snmp group",
"msg": "Success",
"code": "200",
"body": {
"TABLE_role": {
"ROW_role": [
{
"role_name": "aaa-db-admin",
"role_description": "Predefined AAA DB admin, has no cli permissions. Allows RESTful API",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "aaa-db-operator",
"role_description": "Predefined AAA DB operator, has no cli permissions. Allows RESTful API",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read"
}
}
},
{
"role_name": "l3-db-admin",
"role_description": "Predefined L3 DB admin, has no cli permissions. Allows RESTful API",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "l3-db-operator",
"role_description": "Predefined L3 DB operator, has no cli permissions. Allows RESTful API",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read"
}
}
},
{
"role_name": "network-admin",
"role_description": "Predefined network admin role has access to all commands\n on the switch",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "network-operator",
"role_description": "Predefined network operator role has access to all read\n commands on the switch",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read"
}
}
},
{
"role_name": "nxdb-admin",
"role_description": "Predefined nxdb-admin role has no cli permissions.\n Allows json-rpc get and set.",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "deny",
"rule_permission": "command",
"rule_entity": ""
}
}
},
{
"role_name": "nxdb-operator",
"role_description": "Predefined nxdb-operator role has no cli permissions.\n Allows json-rpc get.",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "deny",
"rule_permission": "command",
"rule_entity": ""
}
}
},
{
"role_name": "vdc-admin",
"role_description": "Predefined vdc admin role has access to all commands within\n a VDC instance",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "vdc-operator",
"role_description": "Predefined vdc operator role has access to all read commands\n within a VDC instance",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read"
}
}
},
{
"role_name": "dev-ops",
"role_description": "Predefined system role for devops access. This role\n cannot be modified.",
"TABLE_rule": {
"ROW_rule": [
{
"rule_num": 6,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "conf t ; username *"
},
{
"rule_num": 5,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "attach module *"
},
{
"rule_num": 4,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "slot *"
},
{
"rule_num": 3,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "bcm module *"
},
{
"rule_num": 2,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "run bash *"
},
{
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "python *"
}
]
}
},
{
"role_name": "priv-15",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "priv-14",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)",
"TABLE_rule": {
"ROW_rule": {
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read-write"
}
}
},
{
"role_name": "priv-13",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-12",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-11",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-10",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-9",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-8",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-7",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-6",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-5",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-4",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-3",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-2",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-1",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)"
},
{
"role_name": "priv-0",
"role_description": "This is a system defined privilege role.",
"permit_vlan": "permit (default)",
"permit_interface": "permit (default)",
"permit_vrf": "permit (default)",
"TABLE_rule": {
"ROW_rule": [
{
"rule_num": 10,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "traceroute6 *"
},
{
"rule_num": 9,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "traceroute *"
},
{
"rule_num": 8,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "telnet6 *"
},
{
"rule_num": 7,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "telnet *"
},
{
"rule_num": 6,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "ping6 *"
},
{
"rule_num": 5,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "ping *"
},
{
"rule_num": 4,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "ssh6 *"
},
{
"rule_num": 3,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "ssh *"
},
{
"rule_num": 2,
"rule_action": "permit",
"rule_permission": "command",
"rule_entity": "enable *"
},
{
"rule_num": 1,
"rule_action": "permit",
"rule_permission": "read"
}
]
}
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp group command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp host
show snmp host
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 snmp host",
"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 snmp host",
"msg": "Success",
"code": "200",
"body": {
"TABLE_host": {
"ROW_host": {
"host": "3.3.3.3",
"port": "162 ",
"version": "v2c ",
"level": "noauth ",
"type": "trap ",
"secname": "public ",
"vrf": "\nUse VRF: management",
"src_intf": "\nSource interface: loopback1"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp host command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp nms-statistics
show snmp nms-statistics
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 snmp nms-statistics",
"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 snmp nms-statistics",
"msg": "Success",
"code": "200",
"body": {
"header": "- SNMP NMS OID Stats -\n",
"nms_stats": "\nNMS IP Address GET GET GET SET First Poll Last Poll\n NEXT BULK\n------------------------------------------------------------------------------------------------------------------------\n10.77.143.230 0 2 0 0 20:21:37:239 Jul 29 2018 20:21:38:241 Jul 29 2018\n"
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp nms-statistics command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp oid-statistics last-access
show snmp oid-statistics last-access
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 snmp oid-statistics last-access",
"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 snmp oid-statistics last-access",
"msg": "Success",
"code": "200",
"body": {
"header": "- SNMP Latest OID Stats -\n",
"TABLE_snmp_la": {
"ROW_snmp_la": [
{
"oid_last_access_stats": "\nObject ID Last Access TS Last Access Last-polled NMS\n Rsp Time\n-------------------------------------------------------------------------------------------------------------------------\n"
},
{
"oid_last_access_stats": "iso.3.6.1.2.1.1.5 20:21:37:239 Jul 29 2018 <1 10.77.143.230\n"
},
{
"oid_last_access_stats": "iso.3.6.1.2.1.1.6 20:21:38:241 Jul 29 2018 <1 10.77.143.230\n"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp oid-statistics last-access command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp sessions
show snmp sessions
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 snmp sessions",
"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 snmp sessions",
"msg": "Success",
"code": "200",
"body": {
"TABLE_session": {
"ROW_session": {
"dest": "3.3.3.3"
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp sessions command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp trap
show snmp trap
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 snmp trap",
"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 snmp trap",
"msg": "Success",
"code": "200",
"body": {
"TABLE_snmp_trap": {
"ROW_snmp_trap": [
{
"trap_type": "entity",
"description": "entity_mib_change",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_module_status_change",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_power_status_change",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_module_inserted",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_module_removed",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_unrecognised_module",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_fan_status_change",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "entity_power_out_change",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "linkDown",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "linkUp",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "extended-linkDown",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "extended-linkUp",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "cieLinkDown",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "cieLinkUp",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "delayed-link-state-change",
"isEnabled": "Yes"
},
{
"trap_type": "callhome",
"description": "event-notify",
"isEnabled": "No"
},
{
"trap_type": "callhome",
"description": "smtp-send-fail",
"isEnabled": "No"
},
{
"trap_type": "cfs",
"description": "state-change-notif",
"isEnabled": "No"
},
{
"trap_type": "cfs",
"description": "merge-failure",
"isEnabled": "No"
},
{
"trap_type": "rf",
"description": "redundancy_framework",
"isEnabled": "Yes"
},
{
"trap_type": "aaa",
"description": "server-state-change",
"isEnabled": "No"
},
{
"trap_type": "license",
"description": "notify-license-expiry",
"isEnabled": "Yes"
},
{
"trap_type": "license",
"description": "notify-no-license-for-feature",
"isEnabled": "Yes"
},
{
"trap_type": "license",
"description": "notify-licensefile-missing",
"isEnabled": "Yes"
},
{
"trap_type": "license",
"description": "notify-license-expiry-warning",
"isEnabled": "Yes"
},
{
"trap_type": "upgrade",
"description": "UpgradeOpNotifyOnCompletion",
"isEnabled": "Yes"
},
{
"trap_type": "upgrade",
"description": "UpgradeJobStatusNotify",
"isEnabled": "Yes"
},
{
"trap_type": "feature-control",
"description": "FeatureOpStatusChange",
"isEnabled": "No"
},
{
"trap_type": "sysmgr",
"description": "cseFailSwCoreNotifyExtended",
"isEnabled": "No"
},
{
"trap_type": "rmon",
"description": "risingAlarm",
"isEnabled": "Yes"
},
{
"trap_type": "rmon",
"description": "fallingAlarm",
"isEnabled": "Yes"
},
{
"trap_type": "rmon",
"description": "hcRisingAlarm",
"isEnabled": "Yes"
},
{
"trap_type": "rmon",
"description": "hcFallingAlarm",
"isEnabled": "Yes"
},
{
"trap_type": "config",
"description": "ccmCLIRunningConfigChanged",
"isEnabled": "No"
},
{
"trap_type": "snmp",
"description": "authentication",
"isEnabled": "No"
},
{
"trap_type": "link",
"description": "cisco-xcvr-mon-status-chg",
"isEnabled": "No"
},
{
"trap_type": "vtp",
"description": "notifs",
"isEnabled": "No"
},
{
"trap_type": "vtp",
"description": "vlancreate",
"isEnabled": "No"
},
{
"trap_type": "vtp",
"description": "vlandelete",
"isEnabled": "No"
},
{
"trap_type": "bridge",
"description": "newroot",
"isEnabled": "No"
},
{
"trap_type": "bridge",
"description": "topologychange",
"isEnabled": "No"
},
{
"trap_type": "stpx",
"description": "inconsistency",
"isEnabled": "No"
},
{
"trap_type": "stpx",
"description": "root-inconsistency",
"isEnabled": "No"
},
{
"trap_type": "stpx",
"description": "loop-inconsistency",
"isEnabled": "No"
},
{
"trap_type": "entity",
"description": "entity_sensor",
"isEnabled": "Yes"
},
{
"trap_type": "entity",
"description": "cefcMIBEnableStatusNotification",
"isEnabled": "Yes"
},
{
"trap_type": "system",
"description": "Clock-change-notification",
"isEnabled": "No"
},
{
"trap_type": "generic",
"description": "coldStart",
"isEnabled": "Yes"
},
{
"trap_type": "generic",
"description": "warmStart",
"isEnabled": "Yes"
},
{
"trap_type": "feature-control",
"description": "ciscoFeatOpStatusChange",
"isEnabled": "No"
},
{
"trap_type": "mmode",
"description": "cseNormalModeChangeNotify",
"isEnabled": "No"
},
{
"trap_type": "mmode",
"description": "cseMaintModeChangeNotify",
"isEnabled": "No"
},
{
"trap_type": "storm-control",
"description": "cpscEventRev1",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "cErrDisableInterfaceEventRev1",
"isEnabled": "Yes"
},
{
"trap_type": "link",
"description": "cmn-mac-move-notification",
"isEnabled": "Yes"
}
]
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp trap command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp user
show snmp user
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 snmp user",
"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 snmp user",
"msg": "Success",
"code": "200",
"body": {
"TABLE_snmp_users": {
"ROW_snmp_users": [
{
"user": "u1",
"auth": "md5",
"priv": "no",
"group": [
"network-operator",
"priv-5",
"priv-8",
"priv-9",
"network-admin"
]
},
{
"user": "admin",
"auth": "md5",
"priv": "des(no)",
"group": "network-admin"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp user command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(3).
CLI Output |
---|
|
show snmp user test
show snmp user test
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 snmp user test",
"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 snmp user test",
"msg": "Success",
"code": "200",
"body": {
"TABLE_snmp_users": {
"ROW_snmp_users": {
"user": "test ",
"auth": "md5 ",
"priv": "des(no) ",
"TABLE_groups": {
"ROW_groups": {
"group": "network-operator "
}
}
}
}
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp user test command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show snmp source-interface
show snmp source-interface
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 snmp source-interface",
"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 snmp source-interface",
"msg": "Success",
"code": "200",
"body": {
"trap_srcintf": "",
"informs_srcintf": ""
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show snmp source-interface command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|