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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.940000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.948000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:01:10
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.217000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.948000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:01:02
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100







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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp active
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.165000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.706000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:03:46
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.564000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.474000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:03:38
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp all
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.244000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.939000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:04:22
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.043000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.086000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:04:14
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp bfd-sessions

Interface Eth4/1
No. of BFD sessions joined (for IPv4 and IPv6 groups) on this interface: 2

Considering BFD session 1 on Eth4/1
BFD session state: UP
Src address: fe80::da67:d9ff:fe0d:cc1
Dst address: fe80::da67:d9ff:fe0d:a6c1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
Group      - HSRP group ID.
Op         - indicate if group joining ('ADD') or leaving ('DEL') BFD session.
Time(rel)  - duration since group joined BFD session.
Time(abs)  - current date & time.
Ref        - No. of groups that had joined BFD session at that particular time.
State      - HSRP group state.
Req st     - status of HSRP's BFD request.
Req reason - reason HSRP made request to BFD. ('-' implies response received from BFD.)
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:01:22 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:01:24 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface

Considering BFD session 2 on Eth4/1
BFD session state: UP
Src address: 4.4.4.2
Dst address: 4.4.4.1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:01:22 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:01:24 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp bfd-sessions interface ethernet 4/1

Interface Eth4/1
No. of BFD sessions joined (for IPv4 and IPv6 groups) on this interface: 2

Considering BFD session 1 on Eth4/1
BFD session state: UP
Src address: fe80::da67:d9ff:fe0d:cc1
Dst address: fe80::da67:d9ff:fe0d:a6c1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
Group      - HSRP group ID.
Op         - indicate if group joining ('ADD') or leaving ('DEL') BFD session.
Time(rel)  - duration since group joined BFD session.
Time(abs)  - current date & time.
Ref        - No. of groups that had joined BFD session at that particular time.
State      - HSRP group state.
Req st     - status of HSRP's BFD request.
Req reason - reason HSRP made request to BFD. ('-' implies response received from BFD.)
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:02:00 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:02:02 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface

Considering BFD session 2 on Eth4/1
BFD session state: UP
Src address: 4.4.4.2
Dst address: 4.4.4.1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:02:00 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:02:02 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp bfd-sessions ipv4

Interface Eth4/1
No. of BFD sessions joined (for IPv4 and IPv6 groups) on this interface: 2

Considering BFD session 1 on Eth4/1
BFD session state: UP
Src address: 4.4.4.2
Dst address: 4.4.4.1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
Group      - HSRP group ID.
Op         - indicate if group joining ('ADD') or leaving ('DEL') BFD session.
Time(rel)  - duration since group joined BFD session.
Time(abs)  - current date & time.
Ref        - No. of groups that had joined BFD session at that particular time.
State      - HSRP group state.
Req st     - status of HSRP's BFD request.
Req reason - reason HSRP made request to BFD. ('-' implies response received from BFD.)
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:02:58 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:03:01 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp  bfd-sessions ipv6

Interface Eth4/1
No. of BFD sessions joined (for IPv4 and IPv6 groups) on this interface: 2

Considering BFD session 1 on Eth4/1
BFD session state: UP
Src address: fe80::da67:d9ff:fe0d:cc1
Dst address: fe80::da67:d9ff:fe0d:a6c1
No. of HSRP groups joining this BFD session: 1
        Group ID(s): 1
Group      - HSRP group ID.
Op         - indicate if group joining ('ADD') or leaving ('DEL') BFD session.
Time(rel)  - duration since group joined BFD session.
Time(abs)  - current date & time.
Ref        - No. of groups that had joined BFD session at that particular time.
State      - HSRP group state.
Req st     - status of HSRP's BFD request.
Req reason - reason HSRP made request to BFD. ('-' implies response received from BFD.)
------------------------------------------------------------------------------
  Group  Op Time(rel) Time(abs)    Ref State    Req st     Req reason
--------------------------------------------------------------------------------
  1     ADD 00:05:38 (02)-16:12:31  1  Active   ADDED      -
  1     ADD 00:05:41 (02)-16:12:28  1  Active   ADD Tx     BFD configured on interface



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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp brief
:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
 Interface   Grp  Prio P State    Active addr      Standby addr     Group addr
  Eth4/1      1    100  P Active   local            4.4.4.1          4.4.4.100       (conf)
  Eth4/1      1   101  P Active   local            fe80::da67:d9ff:fe0d:a6c1  fe80::5:73ff:fea0:1 (impl auto EUI64)




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp delay
---------------------------------
Interface       Minimum    Reload
---------------------------------
Ethernet4/1      10         10




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp detail
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.491000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.516000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:04:56
  IP redundancy name is hsrp-Eth4/1-1 (default)

 ----- Detailed information -----
 State History
------------------------------------------------------------
  Time          Prev State      State          Event
------------------------------------------------------------
  (02)-16:04:02 Standby         Active          Rx Hello-Lo Pri Act P.
  (02)-16:00:45 Speak           Standby         Sby Timer Expired.
  (02)-16:00:42 Active          Speak           Rx Coup.
  (02)-15:51:28 Standby         Active          Act Timer Expired.
  (02)-15:51:25 Speak           Standby         Sby Timer Expired.
  (02)-15:51:25 Listen          Speak           Act Timer Expired.
  (02)-15:51:22 Initial         Listen          If Enabled-VIP.
Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.673000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.715000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:04:48
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100

 ----- Detailed information -----
 State History
------------------------------------------------------------
  Time          Prev State      State          Event
------------------------------------------------------------
  (02)-16:04:10 Standby         Active          Rx Hello-Lo Pri Act P.
  (02)-16:03:34 Speak           Standby         Sby Timer Expired.
  (02)-16:03:30 Listen          Speak           Sby Timer Expired
  (02)-16:03:25 Speak           Listen          Rx Hl from Hi Pri Sby
  (02)-16:03:25 Listen          Speak           Act Timer Expired.
  (02)-16:03:23 Speak           Listen          Rx Hl from Hi Pri Sby
  (02)-16:03:22 Listen          Speak           Act Timer Expired.
  (02)-16:03:11 Initial         Listen          If Enabled-VIP.
  (02)-16:03:11 No Trans        Initial         N/A.




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp group 1
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.601000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.678000 sec(s)
  BFD enabled on interface  Session active
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:08:59
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.914000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.625000 sec(s)
  BFD enabled on interface  Session active
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:08:51
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp interface ethernet 4/1
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.248000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.350000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:07:38
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.524000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.609000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:07:30
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp interface ethernet 4/1 all
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.078000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.563000 sec(s)
  BFD enabled on interface  Session active
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:16:33
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.845000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.241000 sec(s)
  BFD enabled on interface  Session active
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:16:25
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100






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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp ipv4
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100), may preempt
    Forwarding threshold(for vPC), lower: 90 upper: 100
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.895000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is local
  Standby router is 4.4.4.1 , priority 50 expires in 2.894000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  5 state changes, last state change 00:06:23
  IP redundancy name is hsrp-Eth4/1-1 (default)





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp ipv6
Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Active, priority 101 (Cfged 101), may preempt
    Forwarding threshold(for vPC), lower: 1 upper: 101
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.730000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is local
  Standby router is fe80::da67:d9ff:fe0d:a6c1 , priority 50 expires in 2.693000 sec(s)
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  2 state changes, last state change 00:06:40
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp mgo
Master Name: jsontest
    Master Group: Vlan2 (IPv4) Group 1 (HSRP-V2)
    State is Active
    Slave Groups:
        Interface       Group   State
        Vlan4           4       Active
Master Name: jsontestv6
    Master Group: Vlan2 (IPv6) Group 1 (HSRP-V2)
    State is Active
    Slave Groups:
        Interface       Group   State
        Vlan4           4       Active





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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp mgo brief
------------------------------------------------------------------
  Name         Interface       AF    Group  State           Slaves
------------------------------------------------------------------
  jsontest     Vlan2           (IPv4) 1      Active          1
  jsontestv6   Vlan2           (IPv6) 1      Active          1







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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp mgo name jsontest
Master Name: jsontest
    Master Group: Vlan2 (IPv4) Group 1 (HSRP-V2)
    State is Active
    Slave Groups:
        Interface       Group   State
        Vlan4           4       Active




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp standby
Ethernet4/1 - Group 1 (HSRP-V2) (IPv4)
  Local state is Standby, priority 50 (Cfged 50)
    Forwarding threshold(for vPC), lower: 1 upper: 50
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.536000 sec(s)
  Virtual IP address is 4.4.4.100 (Cfged)
  Active router is 4.4.4.2, priority 100 expires in 2.828000 sec(s)
  BFD enabled on interface  Session active
  Standby router is local
  Authentication MD5, key-chain hsrp
  Virtual mac address is 1234.1234.1234 (Cfged MAC)
  7 state changes, last state change 00:17:37
  IP redundancy name is hsrp-Eth4/1-1 (default)

Ethernet4/1 - Group 1 (HSRP-V2) (IPv6)
  Local state is Standby, priority 50 (Cfged 50)
    Forwarding threshold(for vPC), lower: 1 upper: 50
  Hellotime 1 sec, holdtime 3 sec
  Next hello sent in 0.792000 sec(s)
  Virtual IP address is fe80::5:73ff:fea0:1 (Implicit)
  Active router is fe80::da67:d9ff:fe0d:cc1, priority 101 expires in 2.154000 sec(s)
  BFD enabled on interface  Session active
  Standby router is local
  Authentication MD5, key-chain hsrp
  Virtual mac address is 0005.73a0.0001 (Default MAC)
  4 state changes, last state change 00:17:29
  IP redundancy name is hsrp-Eth4/1-1-V6 (default)
  Secondary VIP(s):
                  4000::100




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:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

Note: This example was added in Cisco NX-OS Release 9.2(1).

CLI Output
Switch# show hsrp summary

HSRP Summary:

Extended-hold (NSF) disabled
Global HSRP-BFD disabled

Total Groups: 2
     Version::    V1-IPV4: 0       V2-IPV4: 1      V2-IPV6: 1
       State::     Active: 1       Standby: 0       Listen: 0
       State::  V6-Active: 1    V6-Standby: 0    V6-Listen: 0

Total HSRP Enabled interfaces: 1

Total Packets:
             Tx - Pass: 1311    Fail: 0
             Rx - Good: 1401

Packet for unknown groups: 0

Total MTS: Rx: 186