show hsrp
show hsrp
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 hsrp",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.544000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 114,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 114,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.950000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 106,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 106,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp active
show hsrp active
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 hsrp active",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.476000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 231,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 231,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.761000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 223,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 223,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp active command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp all
show hsrp all
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 hsrp all",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.348000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 267,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 267,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.072000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 258,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 258,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp all command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp bfd-sessions
show hsrp bfd-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 hsrp bfd-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)
{
"TABLE_bfd_sess": {
"ROW_bfd_sess": [
{
"interface": "Ethernet4/1",
"list_size": 2,
"src_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"dst_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:01:28",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:01:30",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
},
{
"interface": "Ethernet4/1",
"src_addr": "4.4.4.2",
"dst_addr": "4.4.4.1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:01:28",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:01:30",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp bfd-sessions command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp bfd-sessions interface ethernet 4/1
show hsrp bfd-sessions interface ethernet 4/1
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 hsrp bfd-sessions interface ethernet 4/1",
"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)
{
"TABLE_bfd_sess": {
"ROW_bfd_sess": [
{
"interface": "Ethernet4/1",
"list_size": 2,
"src_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"dst_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:02:05",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:02:07",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
},
{
"interface": "Ethernet4/1",
"src_addr": "4.4.4.2",
"dst_addr": "4.4.4.1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:02:05",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:02:07",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp bfd-sessions interface ethernet 4/1 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp bfd-sessions ipv4
show hsrp bfd-sessions ipv4
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 hsrp bfd-sessions ipv4",
"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)
{
"TABLE_bfd_sess": {
"ROW_bfd_sess": {
"interface": "Ethernet4/1",
"list_size": 2,
"src_addr": "4.4.4.2",
"dst_addr": "4.4.4.1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:03:03",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:03:06",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp bfd-sessions ipv4 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp bfd-sessions ipv6
show hsrp bfd-sessions ipv6
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 hsrp bfd-sessions ipv6",
"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)
{
"TABLE_bfd_sess": {
"ROW_bfd_sess": {
"interface": "Ethernet4/1",
"list_size": 2,
"src_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"dst_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"ref_count": 1,
"TABLE_ref_groups": {
"ROW_ref_groups": {
"ref_group_id": 1
}
},
"TABLE_hist_groups": {
"ROW_hist_groups": [
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:05:43",
"hist_abs_time": "(02)-16:12:31",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADDED",
"hist_op_reason": "-"
},
{
"hist_group_id": 1,
"hist_operation": "ADD",
"hist_rel_time": "00:05:45",
"hist_abs_time": "(02)-16:12:28",
"hist_ref_count": 1,
"hist_group_state": "Active",
"hist_status": "ADD Tx",
"hist_op_reason": "BFD configured on interface"
}
]
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp bfd-sessions ipv6 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp brief
show hsrp brief
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 hsrp brief",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.047000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 175,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 175,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.371000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 167,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 167,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp brief command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp delay
show hsrp delay
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 hsrp delay",
"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)
{
"TABLE_delay": {
"ROW_delay": {
"interface": "Ethernet4/1",
"min_delay": 10,
"reload_delay": 10
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp delay command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp detail
show hsrp detail
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 hsrp detail",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.935000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 303,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 303,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.019000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 295,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 295,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp detail command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp group 1
show hsrp group 1
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 hsrp group 1",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.557000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 562,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 562,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.473000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 554,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 554,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp group 1 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp interface ethernet 4/1
show hsrp interface ethernet 4/1
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 hsrp interface ethernet 4/1",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.279000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 463,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 463,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.472000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 455,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 455,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp interface ethernet 4/1 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp interface ethernet 4/1 all
show hsrp interface ethernet 4/1 all
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 hsrp interface ethernet 4/1 all",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.121000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 1019,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 1019,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.702000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 1011,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 1011,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp interface ethernet 4/1 all command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp ipv4
show hsrp ipv4
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 hsrp ipv4",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": {
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 100,
"sh_cfg_prio": 100,
"sh_fwd_lower_threshold": 90,
"sh_fwd_upper_threshold": 100,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.902000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 5,
"sh_last_state_change": 387,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 387,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp ipv4 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp ipv6
show hsrp ipv6
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 hsrp ipv6",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": {
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Active",
"sh_prio": 101,
"sh_cfg_prio": 101,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 101,
"sh_can_forward": "enabled",
"sh_preempt": "enabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.307000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "0.000000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 2,
"sh_last_state_change": 404,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 404,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp ipv6 command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp mgo
show hsrp mgo
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 hsrp mgo",
"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)
{
"TABLE_hsrp_mgo": {
"ROW_hsrp_mgo": [
{
"master_name": "jsontest",
"master_interface": "Vlan2",
"master_address_family": "(IPv4)",
"master_group_id": 1,
"master_version": "(HSRP-V2)",
"master_state": "Active",
"TABLE_slave": {
"ROW_slave": {
"slave_interface": "Vlan4",
"slave_group_id": 4,
"slave_state": "Active"
}
}
},
{
"master_name": "jsontestv6",
"master_interface": "Vlan2",
"master_address_family": "(IPv6)",
"master_group_id": 1,
"master_version": "(HSRP-V2)",
"master_state": "Active",
"TABLE_slave": {
"ROW_slave": {
"slave_interface": "Vlan4",
"slave_group_id": 4,
"slave_state": "Active"
}
}
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp mgo command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp mgo brief
show hsrp mgo brief
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 hsrp mgo brief",
"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)
{
"TABLE_hsrp_mgo": {
"ROW_hsrp_mgo": [
{
"master_name": "jsontest",
"master_interface": "Vlan2",
"master_address_family": "(IPv4)",
"master_group_id": 1,
"master_state": "Active",
"num_slave_group": 1
},
{
"master_name": "jsontestv6",
"master_interface": "Vlan2",
"master_address_family": "(IPv6)",
"master_group_id": 1,
"master_state": "Active",
"num_slave_group": 1
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp mgo brief command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp mgo name jsontest
show hsrp mgo name jsontest
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 hsrp mgo name jsontest",
"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)
{
"TABLE_hsrp_mgo": {
"ROW_hsrp_mgo": {
"master_name": "jsontest",
"master_interface": "Vlan2",
"master_address_family": "(IPv4)",
"master_group_id": 1,
"master_version": "(HSRP-V2)",
"master_state": "Active",
"TABLE_slave": {
"ROW_slave": {
"slave_interface": "Vlan4",
"slave_group_id": 4,
"slave_state": "Active"
}
}
}
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp mgo name jsontest command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp standby
show hsrp standby
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 hsrp standby",
"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)
{
"TABLE_grp_detail": {
"ROW_grp_detail": [
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v4",
"sh_group_version": "v2",
"sh_group_state": "Standby",
"sh_prio": 50,
"sh_cfg_prio": 50,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 50,
"sh_can_forward": "enabled",
"sh_preempt": "disabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.765000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip": "4.4.4.100",
"sh_vip_attr": "config",
"sh_active_router_addr": "4.4.4.2",
"sh_active_router_prio": 100,
"sh_active_router_timer": "2.534000",
"sh_standby_router_addr": "4.4.4.1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "1234.1234.1234",
"sh_vmac_attr": "Configured MAC",
"sh_num_of_state_changes": 7,
"sh_last_state_change": 1061,
"sh_num_of_total_state_changes": 9,
"sh_last_total_state_change": 1061,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1",
"sh_ip_redund_name_attr": "Default"
},
{
"sh_if_index": "Ethernet4/1",
"sh_group_num": 1,
"sh_group_type": "v6",
"sh_group_version": "v2",
"sh_group_state": "Standby",
"sh_prio": 50,
"sh_cfg_prio": 50,
"sh_fwd_lower_threshold": 1,
"sh_fwd_upper_threshold": 50,
"sh_can_forward": "enabled",
"sh_preempt": "disabled",
"sh_cur_hello": 1,
"sh_cur_hello_attr": "sec",
"sh_cfg_hello": 1,
"sh_cfg_hello_attr": "sec",
"sh_active_hello": "0.359000",
"sh_cur_hold": 3,
"sh_cur_hold_attr": "sec",
"sh_cfg_hold": 3,
"sh_cfg_hold_attr": "sec",
"sh_vip_v6": "fe80::5:73ff:fea0:1",
"sh_vip_attr": "config",
"TABLE_grp_vip_sec": {
"ROW_grp_vip_sec": {
"sh_vip_sec": "0.0.0.64"
}
},
"sh_active_router_addr_v6": "fe80::da67:d9ff:fe0d:cc1",
"sh_active_router_prio": 101,
"sh_active_router_timer": "2.791000",
"sh_standby_router_addr_v6": "fe80::da67:d9ff:fe0d:a6c1",
"sh_standby_router_prio": 50,
"sh_authentication_type": "md5",
"sh_authentication_data": "hsrp",
"sh_vmac": "0005.73a0.0001",
"sh_vmac_attr": "Default MAC",
"sh_num_of_state_changes": 4,
"sh_last_state_change": 1053,
"sh_num_of_total_state_changes": 7,
"sh_last_total_state_change": 1053,
"sh_num_track_obj": 0,
"sh_ip_redund_name": "hsrp-Eth4/1-1-V6",
"sh_ip_redund_name_attr": "Default"
}
]
}
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp standby command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|
show hsrp summary
show hsrp summary
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 hsrp summary",
"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)
{
"switchover_notify_rxed": "Extended-hold (NSF) disabled",
"bfd_enabled": "Global HSRP-BFD disabled",
"num_of_groups": 2,
"num_of_v4_v1_groups": 0,
"num_of_v4_v2_groups": 1,
"num_of_v6_v2_groups": 1,
"num_of_active_groups": 1,
"num_of_standby_groups": 0,
"num_of_listen_groups": 0,
"num_of_v6_active_groups": 1,
"num_of_v6_standby_groups": 0,
"num_of_v6_listen_groups": 0,
"num_of_hsrp_enabled_ifs": 1,
"counter_pkts_tx": 1319,
"counter_pkts_tx_failure": 0,
"counter_pkts_in": 1409,
"counter_pkts_bad_vr": 0,
"counter_mts_rx": 187
}
The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hsrp summary command, see the CLI command reference:
Note: This example was added in Cisco NX-OS Release 9.2(1).
CLI Output |
---|
|