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": {
"outputs": {
"output": {
"body": {
"TABLE_host": {
"ROW_host": [
{
"host": "10.157.150.137",
"level": "noauth ",
"port": "162 ",
"secname": "public ",
"type": "trap ",
"version": "v2c "
},
{
"host": "172.22.49.19",
"level": "noauth ",
"port": "2162 ",
"secname": "public ",
"type": "trap ",
"version": "v2c "
},
{
"host": "172.31.146.186",
"level": "noauth ",
"port": "2162 ",
"secname": "public ",
"type": "trap ",
"version": "v2c "
}
]
}
},
"code": "200",
"input": "show snmp host",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
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 7.0(3)I7(4).
| 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": {
"outputs": {
"output": {
"body": {
"TABLE_snmp_trap": {
"ROW_snmp_trap": [
{
"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": "entity"
},
{
"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": "link"
},
{
"description": "event-notify",
"isEnabled": "Yes",
"trap_type": "callhome"
},
{
"description": "smtp-send-fail",
"isEnabled": "Yes",
"trap_type": "callhome"
},
{
"description": "state-change-notif",
"isEnabled": "Yes",
"trap_type": "cfs"
},
{
"description": "merge-failure",
"isEnabled": "Yes",
"trap_type": "cfs"
},
{
"description": "redundancy_framework",
"isEnabled": "Yes",
"trap_type": "rf"
},
{
"description": "server-state-change",
"isEnabled": "Yes",
"trap_type": "aaa"
},
{
"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": "license"
},
{
"description": "UpgradeOpNotifyOnCompletion",
"isEnabled": "Yes",
"trap_type": "upgrade"
},
{
"description": "UpgradeJobStatusNotify",
"isEnabled": "Yes",
"trap_type": "upgrade"
},
{
"description": "FeatureOpStatusChange",
"isEnabled": "Yes",
"trap_type": "feature-control"
},
{
"description": "cseFailSwCoreNotifyExtended",
"isEnabled": "Yes",
"trap_type": "sysmgr"
},
{
"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": "rmon"
},
{
"description": "ccmCLIRunningConfigChanged",
"isEnabled": "Yes",
"trap_type": "config"
},
{
"description": "authentication",
"isEnabled": "Yes",
"trap_type": "snmp"
},
{
"description": "cisco-xcvr-mon-status-chg",
"isEnabled": "Yes",
"trap_type": "link"
},
{
"description": "notifs",
"isEnabled": "Yes",
"trap_type": "vtp"
},
{
"description": "vlancreate",
"isEnabled": "Yes",
"trap_type": "vtp"
},
{
"description": "vlandelete",
"isEnabled": "Yes",
"trap_type": "vtp"
},
{
"description": "newroot",
"isEnabled": "Yes",
"trap_type": "bridge"
},
{
"description": "topologychange",
"isEnabled": "Yes",
"trap_type": "bridge"
},
{
"description": "inconsistency",
"isEnabled": "Yes",
"trap_type": "stpx"
},
{
"description": "root-inconsistency",
"isEnabled": "Yes",
"trap_type": "stpx"
},
{
"description": "loop-inconsistency",
"isEnabled": "Yes",
"trap_type": "stpx"
},
{
"description": "entity_sensor",
"isEnabled": "Yes",
"trap_type": "entity"
},
{
"description": "cefcMIBEnableStatusNotification",
"isEnabled": "Yes",
"trap_type": "entity"
},
{
"description": "Clock-change-notification",
"isEnabled": "Yes",
"trap_type": "system"
},
{
"description": "coldStart",
"isEnabled": "Yes",
"trap_type": "generic"
},
{
"description": "warmStart",
"isEnabled": "Yes",
"trap_type": "generic"
},
{
"description": "ciscoFeatOpStatusChange",
"isEnabled": "Yes",
"trap_type": "feature-control"
},
{
"description": "cseNormalModeChangeNotify",
"isEnabled": "Yes",
"trap_type": "mmode"
},
{
"description": "cseMaintModeChangeNotify",
"isEnabled": "Yes",
"trap_type": "mmode"
},
{
"description": "cpscEventRev1",
"isEnabled": "Yes",
"trap_type": "storm-control"
},
{
"description": "cErrDisableInterfaceEventRev1",
"isEnabled": "Yes",
"trap_type": "link"
},
{
"description": "lldpRemTablesChange",
"isEnabled": "Yes",
"trap_type": "lldp"
},
{
"description": "session-up",
"isEnabled": "Yes",
"trap_type": "bfd"
},
{
"description": "session-down",
"isEnabled": "Yes",
"trap_type": "bfd"
},
{
"description": "OSPF base traps",
"isEnabled": "Yes",
"trap_type": "ospf-2"
},
{
"description": "OSPF LSA",
"isEnabled": "Yes",
"trap_type": "ospf-2"
},
{
"description": "OSPF base traps",
"isEnabled": "Yes",
"trap_type": "ospf-csco"
},
{
"description": "OSPF LSA",
"isEnabled": "Yes",
"trap_type": "ospf-csco"
},
{
"description": "OSPFV3 base traps",
"isEnabled": "Yes",
"trap_type": "ospfv3-csco"
},
{
"description": "OSPFV3 LSA",
"isEnabled": "Yes",
"trap_type": "ospfv3-csco"
},
{
"description": "",
"isEnabled": "No",
"trap_type": "BGP-64552"
}
]
}
},
"code": "200",
"input": "show snmp trap",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
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 7.0(3)I7(4).
| 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": {
"outputs": {
"output": {
"body": {
"TABLE_snmp_users": {
"ROW_snmp_users": [
{
"TABLE_groups": {
"ROW_groups": {
"group": "network-admin "
}
},
"auth": "md5 ",
"priv": "des(no) ",
"user": "admin "
},
{
"TABLE_groups": {
"ROW_groups": {
"group": "network-admin "
}
},
"auth": "md5 ",
"priv": "no ",
"user": "dcnmuser "
},
{
"TABLE_groups": {
"ROW_groups": {
"group": "network-admin "
}
},
"acl_filter": "ipv4:testSnmpV3 ",
"auth": "md5 ",
"priv": "des(no) ",
"user": "snmpAclUser "
},
{
"TABLE_groups": {
"ROW_groups": {
"group": "network-operator "
}
},
"acl_filter": "ipv4:testSnmpV3 ",
"auth": "md5 ",
"priv": "no ",
"user": "snmpAclUser2 "
}
]
}
},
"code": "200",
"input": "show snmp user",
"msg": "Success"
}
},
"sid": "eoc",
"type": "cli_show",
"version": "1.0"
}
}
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 7.0(3)I7(4).
| CLI Output |
|---|
|