show HSRP Commands

show hsrp

show hsrp
 
import requests
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"
      }
    ]
  }
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <__readonly__>
     <TABLE_grp_detail>
      <ROW_grp_detail>
       <sh_if_index>Ethernet4/13</sh_if_index>
       <sh_group_num>1</sh_group_num>
       <sh_group_type>v4</sh_group_type>
       <sh_group_version>v2</sh_group_version>
       <sh_group_state>Active</sh_group_state>
       <sh_prio>100</sh_prio>
       <sh_cfg_prio>100</sh_cfg_prio>
       <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
       <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
       <sh_can_forward>enabled</sh_can_forward>
       <sh_preempt>disabled</sh_preempt>
       <sh_cur_hello>3</sh_cur_hello>
       <sh_cur_hello_attr>sec</sh_cur_hello_attr>
       <sh_active_hello>2.178000</sh_active_hello>
       <sh_cur_hold>10</sh_cur_hold>
       <sh_cur_hold_attr>sec</sh_cur_hold_attr>
       <sh_vip>30.0.0.100</sh_vip>
       <sh_vip_attr>config</sh_vip_attr>
       <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
       <sh_active_router_prio>100</sh_active_router_prio>
       <sh_active_router_timer>0.000000</sh_active_router_timer>
       <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
       <sh_standby_router_prio>100</sh_standby_router_prio>
       <sh_authentication_type>text</sh_authentication_type>
       <sh_authentication_data>cisco</sh_authentication_data>
       <sh_vmac>0000.0c9f.f001</sh_vmac>
       <sh_vmac_attr>Default MAC</sh_vmac_attr>
       <sh_num_of_state_changes>2</sh_num_of_state_changes>
       <sh_last_state_change>157</sh_last_state_change>
       <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
       <sh_last_total_state_change>157</sh_last_total_state_change>
       <sh_num_track_obj>0</sh_num_track_obj>
       <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
       <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
      </ROW_grp_detail>
     </TABLE_grp_detail>
    </__readonly__>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp**

Ethernet4/13 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100)
    Forwarding threshold(for vPC), lower: 1 upper: 100
  Hellotime 3 sec, holdtime 10 sec
  Next hello sent in 2.098000 sec(s)
  Virtual IP address is 30.0.0.100 (Cfged)
  Active router is local
  Standby router is 30.0.0.15 , priority 100 expires in 8.895000 sec(s)
  Authentication text "cisco"
  Virtual mac address is 0000.0c9f.f001 (Default MAC)
  2 state changes, last state change 00:02:32
  IP redundancy name is hsrp-Eth4/13-1 (default)

show hsrp interface ethernet

show hsrp interface ethernet 
 
import requests
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/13”,
  "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/13”,
        "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/13-1”,
        "sh_ip_redund_name_attr": "Default"
      },
      {
        "sh_if_index": "Ethernet4/13”,
        "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"
      }
    ]
  }
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <interface>
     <__XML__PARAM__interface-id>
      <__XML__value>Ethernet4/13</__XML__value>
      <__readonly__>
       <TABLE_grp_detail>
        <ROW_grp_detail>
         <sh_if_index>Ethernet4/13</sh_if_index>
         <sh_group_num>1</sh_group_num>
         <sh_group_type>v4</sh_group_type>
         <sh_group_version>v2</sh_group_version>
         <sh_group_state>Active</sh_group_state>
         <sh_prio>100</sh_prio>
         <sh_cfg_prio>100</sh_cfg_prio>
         <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
         <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
         <sh_can_forward>enabled</sh_can_forward>
         <sh_preempt>disabled</sh_preempt>
         <sh_cur_hello>3</sh_cur_hello>
         <sh_cur_hello_attr>sec</sh_cur_hello_attr>
         <sh_active_hello>1.825000</sh_active_hello>
         <sh_cur_hold>10</sh_cur_hold>
         <sh_cur_hold_attr>sec</sh_cur_hold_attr>
         <sh_vip>30.0.0.100</sh_vip>
         <sh_vip_attr>config</sh_vip_attr>
         <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
         <sh_active_router_prio>100</sh_active_router_prio>
         <sh_active_router_timer>0.000000</sh_active_router_timer>
         <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
         <sh_standby_router_prio>100</sh_standby_router_prio>
         <sh_authentication_type>text</sh_authentication_type>
         <sh_authentication_data>cisco</sh_authentication_data>
         <sh_vmac>0000.0c9f.f001</sh_vmac>
         <sh_vmac_attr>Default MAC</sh_vmac_attr>
         <sh_num_of_state_changes>2</sh_num_of_state_changes>
         <sh_last_state_change>192</sh_last_state_change>
         <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
         <sh_last_total_state_change>192</sh_last_total_state_change>
         <sh_num_track_obj>0</sh_num_track_obj>
         <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
         <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
        </ROW_grp_detail>
       </TABLE_grp_detail>
      </__readonly__>
     </__XML__PARAM__interface-id>
    </interface>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp interface ethernet 4/13**

Ethernet4/13 - Group 1 (HSRP-V2) (IPv4) Local state is Active, priority 100 (Cfged 100) Forwarding threshold(for vPC), lower: 1 upper: 100 Hellotime 3 sec, holdtime 10 sec Next hello sent in 0.831000 sec(s) Virtual IP address is 30.0.0.100 (Cfged) Active router is local Standby router is 30.0.0.15 , priority 100 expires in 8.296000 sec(s) Authentication text "cisco" Virtual mac address is 0000.0c9f.f001 (Default MAC) 2 state changes, last state change 00:03:07 IP redundancy name is hsrp-Eth4/13-1 (default)

show hsrp group

show hsrp group 1
 
import requests
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"
      }
    ]
  }
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <group>
     <__XML__PARAM__group-number>
      <__XML__value>1</__XML__value>
      <__readonly__>
       <TABLE_grp_detail>
        <ROW_grp_detail>
         <sh_if_index>Ethernet4/13</sh_if_index>
         <sh_group_num>1</sh_group_num>
         <sh_group_type>v4</sh_group_type>
         <sh_group_version>v2</sh_group_version>
         <sh_group_state>Active</sh_group_state>
         <sh_prio>100</sh_prio>
         <sh_cfg_prio>100</sh_cfg_prio>
         <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
         <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
         <sh_can_forward>enabled</sh_can_forward>
         <sh_preempt>disabled</sh_preempt>
         <sh_cur_hello>3</sh_cur_hello>
         <sh_cur_hello_attr>sec</sh_cur_hello_attr>
         <sh_active_hello>1.337000</sh_active_hello>
         <sh_cur_hold>10</sh_cur_hold>
         <sh_cur_hold_attr>sec</sh_cur_hold_attr>
         <sh_vip>30.0.0.100</sh_vip>
         <sh_vip_attr>config</sh_vip_attr>
         <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
         <sh_active_router_prio>100</sh_active_router_prio>
         <sh_active_router_timer>0.000000</sh_active_router_timer>
         <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
         <sh_standby_router_prio>100</sh_standby_router_prio>
         <sh_authentication_type>text</sh_authentication_type>
         <sh_authentication_data>cisco</sh_authentication_data>
         <sh_vmac>0000.0c9f.f001</sh_vmac>
         <sh_vmac_attr>Default MAC</sh_vmac_attr>
         <sh_num_of_state_changes>2</sh_num_of_state_changes>
         <sh_last_state_change>209</sh_last_state_change>
         <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
         <sh_last_total_state_change>209</sh_last_total_state_change>
         <sh_num_track_obj>0</sh_num_track_obj>
         <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
         <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
        </ROW_grp_detail>
       </TABLE_grp_detail>
      </__readonly__>
     </__XML__PARAM__group-number>
    </group>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 active

show hsrp active
 
import requests
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"
      }
    ]
  }
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <active>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>0.377000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>230</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>230</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </active>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp active**

all       detail    ipv4      learn     speak
brief     init      ipv6      listen    standby
N7k-uut1-3# show hsrp active
Ethernet4/13 - Group 1 (HSRP-V2) (IPv4)
  Local state is Active, priority 100 (Cfged 100)
    Forwarding threshold(for vPC), lower: 1 upper: 100
  Hellotime 3 sec, holdtime 10 sec
  Next hello sent in 2.241000 sec(s)
  Virtual IP address is 30.0.0.100 (Cfged)
  Active router is local
  Standby router is 30.0.0.15 , priority 100 expires in 7.361000 sec(s)
  Authentication text "cisco"
  Virtual mac address is 0000.0c9f.f001 (Default MAC)
  2 state changes, last state change 00:03:46
  IP redundancy name is hsrp-Eth4/13-1 (default)

show hsrp brief

show hsrp brief
 
import requests
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"
      }
    ]
  }
}
<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <brief>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>0.480000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>250</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>250</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </brief>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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/13 1 100 Active local 30.0.0.15 30.0.0.100 (conf)

show hsrp all

show hsrp all
 
import requests
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"
      }
    ]
  }
}


<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <all>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>0.251000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>268</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>268</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </all>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 detail

show hsrp detail
 
import requests
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"
      }
    ]
  }
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <detail>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>1.112000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>278</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>278</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </detail>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>


For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 ipv4

show hsrp ipv4
 
import requests
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"
    }
  }
}

<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <ipv4>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>0.779000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>290</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>290</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </ipv4>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>



For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp ipv4**

Ethernet4/13 - Group 1 (HSRP-V2) (IPv4) Local state is Active, priority 100 (Cfged 100) Forwarding threshold(for vPC), lower: 1 upper: 100 Hellotime 3 sec, holdtime 10 sec Next hello sent in 1.285000 sec(s) Virtual IP address is 30.0.0.100 (Cfged) Active router is local Standby router is 30.0.0.15 , priority 100 expires in 8.266000 sec(s) Authentication text "cisco" Virtual mac address is 0000.0c9f.f001 (Default MAC) 2 state changes, last state change 00:04:47 IP redundancy name is hsrp-Eth4/13-1 (default)

show hsrp ipv6

show hsrp ipv6
 
import requests
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"
    }
  }
}



<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <ipv6>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/13</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v6</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Active</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>2.483000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip_v6>fe80::100</sh_vip_v6>
        <sh_vip_attr>config</sh_vip_attr>
        <TABLE_grp_vip_sec>
         <ROW_grp_vip_sec>
          <sh_vip_sec>0.0.0.48</sh_vip_sec>
         </ROW_grp_vip_sec>
        </TABLE_grp_vip_sec>
        <sh_active_router_addr_v6>fe80::da67:d9ff:fe0d:a6c3</sh_active_router_ad
dr_v6>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>0.000000</sh_active_router_timer>
        <sh_standby_router_addr_v6>0::</sh_standby_router_addr_v6>
        <sh_standby_router_prio>0</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0005.73a0.0001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>2</sh_num_of_state_changes>
        <sh_last_state_change>27</sh_last_state_change>
        <sh_num_of_total_state_changes>5</sh_num_of_total_state_changes>
        <sh_last_total_state_change>27</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/13-1-V6</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </ipv6>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch(config-if-hsrp)# **show hsrp ipv6**

Ethernet4/13 - Group 1 (HSRP-V2) (IPv6) Local state is Active, priority 100 (Cfged 100) Forwarding threshold(for vPC), lower: 1 upper: 100 Hellotime 3 sec, holdtime 10 sec Next hello sent in 1.026000 sec(s) Virtual IP address is fe80::100 (Cfged) Active router is local Standby router is unknown Authentication text "cisco" Virtual mac address is 0005.73a0.0001 (Default MAC) 2 state changes, last state change 00:00:23 IP redundancy name is hsrp-Eth4/13-1-V6 (default) Secondary VIP(s): 3000::100

show hsrp standby

show hsrp standby
 
import requests
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"
      }
    ]
  }
}




<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <standby>
     <__readonly__>
      <TABLE_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/5</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v4</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Standby</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>2.357000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip>30.0.0.100</sh_vip>
        <sh_vip_attr>config</sh_vip_attr>
        <sh_active_router_addr>30.0.0.16</sh_active_router_addr>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>3.033000</sh_active_router_timer>
        <sh_standby_router_addr>30.0.0.15</sh_standby_router_addr>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0000.0c9f.f001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>1</sh_num_of_state_changes>
        <sh_last_state_change>408</sh_last_state_change>
        <sh_num_of_total_state_changes>3</sh_num_of_total_state_changes>
        <sh_last_total_state_change>408</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/5-1</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
       <ROW_grp_detail>
        <sh_if_index>Ethernet4/5</sh_if_index>
        <sh_group_num>1</sh_group_num>
        <sh_group_type>v6</sh_group_type>
        <sh_group_version>v2</sh_group_version>
        <sh_group_state>Standby</sh_group_state>
        <sh_prio>100</sh_prio>
        <sh_cfg_prio>100</sh_cfg_prio>
        <sh_fwd_lower_threshold>1</sh_fwd_lower_threshold>
        <sh_fwd_upper_threshold>100</sh_fwd_upper_threshold>
        <sh_can_forward>enabled</sh_can_forward>
        <sh_preempt>disabled</sh_preempt>
        <sh_cur_hello>3</sh_cur_hello>
        <sh_cur_hello_attr>sec</sh_cur_hello_attr>
        <sh_active_hello>0.541000</sh_active_hello>
        <sh_cur_hold>10</sh_cur_hold>
        <sh_cur_hold_attr>sec</sh_cur_hold_attr>
        <sh_vip_v6>fe80::100</sh_vip_v6>
        <sh_vip_attr>config</sh_vip_attr>
        <TABLE_grp_vip_sec>
         <ROW_grp_vip_sec>
          <sh_vip_sec>0.0.0.48</sh_vip_sec>
         </ROW_grp_vip_sec>
        </TABLE_grp_vip_sec>
        <sh_active_router_addr_v6>fe80::da67:d9ff:fe0d:a6c3</sh_active_router_ad
dr_v6>
        <sh_active_router_prio>100</sh_active_router_prio>
        <sh_active_router_timer>7.875000</sh_active_router_timer>
        <sh_standby_router_addr_v6>fe80::da67:d9ff:fe0d:a6c2</sh_standby_router_
addr_v6>
        <sh_standby_router_prio>100</sh_standby_router_prio>
        <sh_authentication_type>text</sh_authentication_type>
        <sh_authentication_data>cisco</sh_authentication_data>
        <sh_vmac>0005.73a0.0001</sh_vmac>
        <sh_vmac_attr>Default MAC</sh_vmac_attr>
        <sh_num_of_state_changes>1</sh_num_of_state_changes>
        <sh_last_state_change>16</sh_last_state_change>
        <sh_num_of_total_state_changes>4</sh_num_of_total_state_changes>
        <sh_last_total_state_change>16</sh_last_total_state_change>
        <sh_num_track_obj>0</sh_num_track_obj>
        <sh_ip_redund_name>hsrp-Eth4/5-1-V6</sh_ip_redund_name>
        <sh_ip_redund_name_attr>Default</sh_ip_redund_name_attr>
       </ROW_grp_detail>
      </TABLE_grp_detail>
     </__readonly__>
    </standby>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 bfd-sessions

show hsrp bfd-sessions
 
import requests
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"
            }
          ]
        }
      }
    ]
  }
}





<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <bfd-sessions>
     <__readonly__>
      <TABLE_bfd_sess>
       <ROW_bfd_sess>
        <interface>Ethernet4/13</interface>
        <list_size>2</list_size>
        <src_addr_v6>fe80::da67:d9ff:fe0d:a6c3</src_addr_v6>
        <dst_addr_v6>fe80::da67:d9ff:fe0d:a6c2</dst_addr_v6>
        <ref_count>1</ref_count>
        <TABLE_ref_groups>
         <ROW_ref_groups>
          <ref_group_id>1</ref_group_id>
         </ROW_ref_groups>
        </TABLE_ref_groups>
        <TABLE_hist_groups>
         <ROW_hist_groups>
          <hist_group_id>1</hist_group_id>
          <hist_operation>ADD</hist_operation>
          <hist_rel_time>00:00:09</hist_rel_time>
          <hist_abs_time>(11)-12:30:21</hist_abs_time>
          <hist_ref_count>1</hist_ref_count>
          <hist_group_state>Active</hist_group_state>
          <hist_status>ADDED</hist_status>
          <hist_op_reason>-</hist_op_reason>
         </ROW_hist_groups>
         <ROW_hist_groups>
          <hist_group_id>1</hist_group_id>
          <hist_operation>ADD</hist_operation>
          <hist_rel_time>00:00:12</hist_rel_time>
          <hist_abs_time>(11)-12:30:19</hist_abs_time>
          <hist_ref_count>1</hist_ref_count>
          <hist_group_state>Active</hist_group_state>
          <hist_status>ADD Tx</hist_status>
          <hist_op_reason>BFD configured on interface</hist_op_reason>
         </ROW_hist_groups>
        </TABLE_hist_groups>
       </ROW_bfd_sess>
       <ROW_bfd_sess>
        <interface>Ethernet4/13</interface>
        <src_addr>30.0.0.16</src_addr>
        <dst_addr>30.0.0.15</dst_addr>
        <ref_count>1</ref_count>
        <TABLE_ref_groups>
         <ROW_ref_groups>
          <ref_group_id>1</ref_group_id>
         </ROW_ref_groups>
        </TABLE_ref_groups>
        <TABLE_hist_groups>
         <ROW_hist_groups>
          <hist_group_id>1</hist_group_id>
          <hist_operation>ADD</hist_operation>
          <hist_rel_time>00:00:09</hist_rel_time>
          <hist_abs_time>(11)-12:30:21</hist_abs_time>
          <hist_ref_count>1</hist_ref_count>
          <hist_group_state>Active</hist_group_state>
          <hist_status>ADDED</hist_status>
          <hist_op_reason>-</hist_op_reason>
         </ROW_hist_groups>
         <ROW_hist_groups>
          <hist_group_id>1</hist_group_id>
          <hist_operation>ADD</hist_operation>
          <hist_rel_time>00:00:12</hist_rel_time>
          <hist_abs_time>(11)-12:30:19</hist_abs_time>
          <hist_ref_count>1</hist_ref_count>
          <hist_group_state>Active</hist_group_state>
          <hist_status>ADD Tx</hist_status>
          <hist_op_reason>BFD configured on interface</hist_op_reason>
         </ROW_hist_groups>
        </TABLE_hist_groups>
       </ROW_bfd_sess>
      </TABLE_bfd_sess>
     </__readonly__>
    </bfd-sessions>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>


For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 interface ethernet

show hsrp interface ethernet 4/1 
 
import requests
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_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"
            }
          ]
        }
      }
    ]
  }
}





<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <bfd-sessions>
     <interface>
      <__XML__PARAM__interface-id>
       <__XML__value>Ethernet4/1</__XML__value>
       <__readonly__>
        <TABLE_bfd_sess>
         <ROW_bfd_sess>
          <interface>Ethernet4/1</interface>
          <list_size>2</list_size>
          <src_addr_v6>fe80::da67:d9ff:fe0d:a6c3</src_addr_v6>
          <dst_addr_v6>fe80::da67:d9ff:fe0d:a6c2</dst_addr_v6>
          <ref_count>1</ref_count>
          <TABLE_ref_groups>
           <ROW_ref_groups>
            <ref_group_id>1</ref_group_id>
           </ROW_ref_groups>
          </TABLE_ref_groups>
          <TABLE_hist_groups>
           <ROW_hist_groups>
            <hist_group_id>1</hist_group_id>
            <hist_operation>ADD</hist_operation>
            <hist_rel_time>00:01:00</hist_rel_time>
            <hist_abs_time>(11)-12:30:21</hist_abs_time>
            <hist_ref_count>1</hist_ref_count>
            <hist_group_state>Active</hist_group_state>
            <hist_status>ADDED</hist_status>
            <hist_op_reason>-</hist_op_reason>
           </ROW_hist_groups>
           <ROW_hist_groups>
            <hist_group_id>1</hist_group_id>
            <hist_operation>ADD</hist_operation>
            <hist_rel_time>00:01:02</hist_rel_time>
            <hist_abs_time>(11)-12:30:19</hist_abs_time>
            <hist_ref_count>1</hist_ref_count>
            <hist_group_state>Active</hist_group_state>
            <hist_status>ADD Tx</hist_status>
            <hist_op_reason>BFD configured on interface</hist_op_reason>
           </ROW_hist_groups>
          </TABLE_hist_groups>
         </ROW_bfd_sess>
         <ROW_bfd_sess>
          <interface>Ethernet4/1</interface>
          <src_addr>30.0.0.16</src_addr>
          <dst_addr>30.0.0.15</dst_addr>
          <ref_count>1</ref_count>
          <TABLE_ref_groups>
           <ROW_ref_groups>
            <ref_group_id>1</ref_group_id>
           </ROW_ref_groups>
          </TABLE_ref_groups>
          <TABLE_hist_groups>
           <ROW_hist_groups>
            <hist_group_id>1</hist_group_id>
            <hist_operation>ADD</hist_operation>
            <hist_rel_time>00:01:00</hist_rel_time>
            <hist_abs_time>(11)-12:30:21</hist_abs_time>
            <hist_ref_count>1</hist_ref_count>
            <hist_group_state>Active</hist_group_state>
            <hist_status>ADDED</hist_status>
            <hist_op_reason>-</hist_op_reason>
           </ROW_hist_groups>
           <ROW_hist_groups>
            <hist_group_id>1</hist_group_id>
            <hist_operation>ADD</hist_operation>
            <hist_rel_time>00:01:02</hist_rel_time>
            <hist_abs_time>(11)-12:30:19</hist_abs_time>
            <hist_ref_count>1</hist_ref_count>
            <hist_group_state>Active</hist_group_state>
            <hist_status>ADD Tx</hist_status>
            <hist_op_reason>BFD configured on interface</hist_op_reason>
           </ROW_hist_groups>
          </TABLE_hist_groups>
         </ROW_bfd_sess>
        </TABLE_bfd_sess>
       </__readonly__>
      </__XML__PARAM__interface-id>
     </interface>
    </bfd-sessions>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>


For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp 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 requests
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"
          }
        ]
      }
    }
  }
}




<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <bfd-sessions>
     <ipv4>
      <__readonly__>
       <TABLE_bfd_sess>
        <ROW_bfd_sess>
         <interface>Ethernet4/13</interface>
         <list_size>2</list_size>
         <src_addr>30.0.0.16</src_addr>
         <dst_addr>30.0.0.15</dst_addr>
         <ref_count>1</ref_count>
         <TABLE_ref_groups>
          <ROW_ref_groups>
           <ref_group_id>1</ref_group_id>
          </ROW_ref_groups>
         </TABLE_ref_groups>
         <TABLE_hist_groups>
          <ROW_hist_groups>
           <hist_group_id>1</hist_group_id>
           <hist_operation>ADD</hist_operation>
           <hist_rel_time>00:01:25</hist_rel_time>
           <hist_abs_time>(11)-12:30:21</hist_abs_time>
           <hist_ref_count>1</hist_ref_count>
           <hist_group_state>Active</hist_group_state>
           <hist_status>ADDED</hist_status>
           <hist_op_reason>-</hist_op_reason>
          </ROW_hist_groups>
          <ROW_hist_groups>
           <hist_group_id>1</hist_group_id>
           <hist_operation>ADD</hist_operation>
           <hist_rel_time>00:01:28</hist_rel_time>
           <hist_abs_time>(11)-12:30:19</hist_abs_time>
           <hist_ref_count>1</hist_ref_count>
           <hist_group_state>Active</hist_group_state>
           <hist_status>ADD Tx</hist_status>
           <hist_op_reason>BFD configured on interface</hist_op_reason>
          </ROW_hist_groups>
         </TABLE_hist_groups>
        </ROW_bfd_sess>
       </TABLE_bfd_sess>
      </__readonly__>
     </ipv4>
    </bfd-sessions>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 summary

show hsrp summary
 
import requests
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
}





<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <summary>
     <__readonly__>
      <switchover_notify_rxed>Extended-hold (NSF) disabled
</switchover_notify_rxed>
      <bfd_enabled>Global HSRP-BFD disabled
</bfd_enabled>
      <num_of_groups>2</num_of_groups>
      <num_of_v4_v1_groups>0</num_of_v4_v1_groups>
      <num_of_v4_v2_groups>1</num_of_v4_v2_groups>
      <num_of_v6_v2_groups>1</num_of_v6_v2_groups>
      <num_of_active_groups>1</num_of_active_groups>
      <num_of_standby_groups>0</num_of_standby_groups>
      <num_of_listen_groups>0</num_of_listen_groups>
      <num_of_v6_active_groups>1</num_of_v6_active_groups>
      <num_of_v6_standby_groups>0</num_of_v6_standby_groups>
      <num_of_v6_listen_groups>0</num_of_v6_listen_groups>
      <num_of_hsrp_enabled_ifs>1</num_of_hsrp_enabled_ifs>
      <counter_pkts_tx>302</counter_pkts_tx>
      <counter_pkts_tx_failure>0</counter_pkts_tx_failure>
      <counter_pkts_in>225</counter_pkts_in>
      <counter_pkts_bad_vr>0</counter_pkts_bad_vr>
      <counter_mts_rx>66</counter_mts_rx>
     </__readonly__>
    </summary>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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

show hsrp delay

show hsrp delay
 
import requests
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
    }
  }
}





<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <delay>
     <__readonly__>
      <TABLE_delay>
       <ROW_delay>
        <interface>Ethernet4/13</interface>
        <min_delay>10</min_delay>
        <reload_delay>10</reload_delay>
       </ROW_delay>
      </TABLE_delay>
     </__readonly__>
    </delay>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp delay**

Interface Minimum Reload

Ethernet4/1 10 10

show hsrp mgo

show hsrp mgo
 
import requests
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"
          }
        }
      }
    ]
  }
}




<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <mgo>
     <__readonly__>
      <TABLE_hsrp_mgo>
       <ROW_hsrp_mgo>
        <master_name>MGO</master_name>
        <master_interface>Ethernet4/13</master_interface>
        <master_address_family>(IPv4)</master_address_family>
        <master_group_id>1</master_group_id>
        <master_version>(HSRP-V2)</master_version>
        <master_state>Active</master_state>
       </ROW_hsrp_mgo>
       <ROW_hsrp_mgo>
        <master_name>MGOv6</master_name>
        <master_interface>Ethernet4/13</master_interface>
        <master_address_family>(IPv6)</master_address_family>
        <master_group_id>1</master_group_id>
        <master_version>(HSRP-V2)</master_version>
        <master_state>Active</master_state>
       </ROW_hsrp_mgo>
      </TABLE_hsrp_mgo>
     </__readonly__>
    </mgo>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>





For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(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 name MGO

show hsrp mgo name MGO
 
import requests
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 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": “MGO”,
      "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"
        }
      }
    }
  }
}






<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <mgo>
     <name>
      <__XML__PARAM__name>
       <__XML__value>MGO</__XML__value>
       <__readonly__>
        <TABLE_hsrp_mgo>
         <ROW_hsrp_mgo>
          <master_name>MGO</master_name>
          <master_interface>Ethernet4/13</master_interface>
          <master_address_family>(IPv4)</master_address_family>
          <master_group_id>1</master_group_id>
          <master_version>(HSRP-V2)</master_version>
          <master_state>Active</master_state>
         </ROW_hsrp_mgo>
        </TABLE_hsrp_mgo>
       </__readonly__>
      </__XML__PARAM__name>
     </name>
    </mgo>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp mgo name MGO**

Master Name: MGO Master Group: Ethernet4/13 (IPv4) Group 1 (HSRP-V2) State is Active Slave Groups: Interface Group State

show hsrp anycast

show hsrp anycast
 
import requests
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 anycast”,
  "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_anycast": {
    "ROW_anycast": {
      "bundle_id": 1,
      "type": "IPv4-v6",
      "admin_status": "Up",
      "oper_status": "Up",
      "switch_id": 1,
      "bundle_priority": 101,
      "bundle_state": "Active",
      "vlan_range": "2"
    }
  }
}







<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <anycast>
     <__readonly__>
      <TABLE_anycast>
       <ROW_anycast>
        <bundle_id>1</bundle_id>
        <type>IPv4-v6</type>
        <admin_status>Down</admin_status>
        <oper_status>Down</oper_status>
        <reason>Reason: Admin/Oper Down, :    </reason>
        <switch_id>1</switch_id>
        <bundle_priority>100</bundle_priority>
        <bundle_state>Initial</bundle_state>
        <vlan_range></vlan_range>
       </ROW_anycast>
      </TABLE_anycast>
     </__readonly__>
    </anycast>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>



For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp anycast**

Anycast bundle - 1 (IPv4-v6) Admin Status: Down Oper Status: Down Reason: Admin/Oper Down, : Anycast Switch ID 1 Bundle priority 100 Bundle State Initial VLAN range: 2

show hsrp anycast brief

show hsrp anycast brief
 
import requests
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 anycast 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_anycast": {
    "ROW_anycast": {
      "bundle_id": 1,
      "type": "IPv4-v6",
      "oper_status": "Up",
      "switch_id": 1,
      "bundle_priority": 101,
      "bundle_state": "Active",
      "track_id": "N/A",
      "vlan_range": "2"
    }
  }
}






<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <anycast>
     <brief>
      <__readonly__>
       <TABLE_anycast>
        <ROW_anycast>
         <bundle_id>1</bundle_id>
         <type>IPv4-v6</type>
         <oper_status>Down</oper_status>
         <switch_id>1</switch_id>
         <bundle_priority>100</bundle_priority>
         <bundle_state>Initial</bundle_state>
         <track_id>N/A</track_id>
         <vlan_range></vlan_range>
        </ROW_anycast>
       </TABLE_anycast>
      </__readonly__>
     </brief>
    </anycast>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>




For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp anycast brief**

 Bundle/addr    Prio Switch.ID Track.ID   State     Vlans
 * = Up

1/IPv4-v6 100 1 N/A Initial

show hsrp anycast summary

show hsrp anycast summary
 
import requests
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 anycast 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)
{
  "total_num_of_bundles": 1,
  "num_of_root_bundles": 1,
  "num_of_non_root_bundles": 0,
  "num_of_admin_down_bundles": 0
}







<?xml version="1.0" encoding="ISO-8859-1"?>
<nf:rpc-reply xmlns="http://www.cisco.com/nxos:8.3.0.SK.1.:hsrp_engine" xmlns:nf
="urn:ietf:params:xml:ns:netconf:base:1.0">
 <nf:data>
  <show>
   <hsrp>
    <anycast>
     <summary>
      <__readonly__>
       <total_num_of_bundles>1</total_num_of_bundles>
       <num_of_root_bundles>0</num_of_root_bundles>
       <num_of_non_root_bundles>1</num_of_non_root_bundles>
       <num_of_admin_down_bundles>1</num_of_admin_down_bundles>
      </__readonly__>
     </summary>
    </anycast>
   </hsrp>
  </show>
 </nf:data>
</nf:rpc-reply>
]]>]]>

For command descriptions, see the Cisco Nexus 7000 Series Switches Command References.   Note: This sample output is generated for Cisco Nexus 7000 Series NX-OS Release 8.3(1).  

CLI Output

switch# **show hsrp anycast summary**

HSRP Anycast Summary:

Total Number of bundles configured: 1 Root bundles: 0 Non-Root bundles: 1 Admin down bundles: 1