show lacp counters

show lacp counters

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 lacp counters  ",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{
  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show lacp counters  ",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_interface": {
            "ROW_interface": [
              {
                "interface": "port-channel1",
                "TABLE_member": {
                  "ROW_member": {
                    "port": "Ethernet1/31",
                    "pdus-sent": "857",
                    "pdus-rcvd": "857",
                    "marker-rcvd": "0",
                    "marker-resp-sent": "0",
                    "pkt-errors": "0"
                  }
                }
              },
              {
                "interface": "port-channel2",
                "TABLE_member": {
                  "ROW_member": [
                    {
                      "port": "Ethernet1/39",
                      "pdus-sent": "858",
                      "pdus-rcvd": "855",
                      "marker-rcvd": "0",
                      "marker-resp-sent": "0",
                      "pkt-errors": "0"
                    },
                    {
                      "port": "Ethernet1/41",
                      "pdus-sent": "858",
                      "pdus-rcvd": "859",
                      "marker-rcvd": "0",
                      "marker-resp-sent": "0",
                      "pkt-errors": "0"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show lacp counters command, see the CLI command reference:

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

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

CLI Output
Switch# show lacp counters
NOTE: Clear lacp counters to get accurate statistics ------------------------------------------------------------------------------ LACPDUs Markers/Resp LACPDUs Port Sent Recv Recv Sent Pkts Err ------------------------------------------------------------------------------ port-channel1 Ethernet1/31 857 857 0 0 0
port-channel2 Ethernet1/39 858 855 0 0 0
Ethernet1/41 858 859 0 0 0

show lacp neighbor

show lacp neighbor

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 lacp neighbor ",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{
  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show lacp neighbor ",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_interface": {
            "ROW_interface": [
              {
                "interface": "port-channel1",
                "TABLE_member": {
                  "ROW_member": {
                    "port": "Ethernet1/31",
                    "partner-system-id": "32768,e8-65-49-cc-92-3f",
                    "partner-port-num": "0x11f",
                    "partner-age": "25168",
                    "partner-flags": "SA",
                    "partner-port-priority": "32768",
                    "partner-oper-key": "0x8000",
                    "partner-port-state": "0x3130303d"
                  }
                }
              },
              {
                "interface": "port-channel2",
                "TABLE_member": {
                  "ROW_member": [
                    {
                      "port": "Ethernet1/39",
                      "partner-system-id": "32768,e8-65-49-cc-92-3f",
                      "partner-port-num": "0x127",
                      "partner-age": "25167",
                      "partner-flags": "SA",
                      "partner-port-priority": "32768",
                      "partner-oper-key": "0x1",
                      "partner-port-state": "0x7461673d"
                    },
                    {
                      "port": "Ethernet1/41",
                      "partner-system-id": "32768,e8-65-49-cc-92-3f",
                      "partner-port-num": "0x129",
                      "partner-age": "25166",
                      "partner-flags": "SA",
                      "partner-port-priority": "32768",
                      "partner-oper-key": "0x1",
                      "partner-port-state": "0x78303d3d"
                    }
                  ]
                }
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show lacp neighbor command, see the CLI command reference:

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

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

CLI Output
Switch# show lacp neighbor
Flags: S - Device is sending Slow LACPDUs F - Device is sending Fast LACPDUs A - Device is in Active mode P - Device is in Passive mode port-channel1 neighbors Partner's information Partner Partner Partner Port System ID Port Number Age Flags Eth1/31 32768,e8-65-49-cc-92-3f0x11f 24965 SA LACP Partner Partner Partner Port Priority Oper Key Port State 32768 0x8000 0x3d Po2 neighbors Partner's information Partner Partner Partner Port System ID Port Number Age Flags Eth1/39 32768,e8-65-49-cc-92-3f0x127 24964 SA LACP Partner Partner Partner Port Priority Oper Key Port State 32768 0x1 0x3d Partner's information Partner Partner Partner Port System ID Port Number Age Flags Eth1/41 32768,e8-65-49-cc-92-3f0x129 24963 SA LACP Partner Partner Partner Port Priority Oper Key Port State 32768 0x1 0x3d

show lacp port-channel

show lacp port-channel

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 lacp port-channel  ",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{
  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show lacp port-channel  ",
        "msg": "Success",
        "code": "200",
        "body": {
          "TABLE_interface": {
            "ROW_interface": [
              {
                "interface": "port-channel1",
                "aggr-mac-address": "2c-d0-2d-50-be-ff",
                "local-system-priority": "0x8000",
                "local-system-id": "2c-d0-2d-50-be-ff",
                "local-admin-key": "0x8001",
                "local-oper-key": "0x8001",
                "partner-system-priority": "0x8000",
                "partner-system-id": "e8-65-49-cc-92-3f",
                "partner-oper-key": "0x8000",
                "max-delay": "0",
                "agg-or-indiv": "0",
                "port-list": "Ethernet1/31"
              },
              {
                "interface": "port-channel2",
                "aggr-mac-address": "2c-d0-2d-50-be-ff",
                "local-system-priority": "0x8000",
                "local-system-id": "2c-d0-2d-50-be-ff",
                "local-admin-key": "0x8002",
                "local-oper-key": "0x8002",
                "partner-system-priority": "0x8000",
                "partner-system-id": "e8-65-49-cc-92-3f",
                "partner-oper-key": "0x1",
                "max-delay": "0",
                "agg-or-indiv": "1",
                "port-list": [
                  "Ethernet1/39",
                  "Ethernet1/41"
                ]
              }
            ]
          }
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show lacp port-channel command, see the CLI command reference:

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

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

CLI Output
Switch# show lacp port-channel
port-channel1 Port Channel Mac=2c-d0-2d-50-be-ff Local System Identifier=0x8000,2c-d0-2d-50-be-ff Admin key=0x8001 Operational key=0x8001 Partner System Identifier=0x8000,e8-65-49-cc-92-3f Operational key=0x8000 Max delay=0 Aggregate or individual=0 Member Port List=Eth1/31 Po2 Port Channel Mac=2c-d0-2d-50-be-ff Local System Identifier=0x8000,2c-d0-2d-50-be-ff Admin key=0x8002 Operational key=0x8002 Partner System Identifier=0x8000,e8-65-49-cc-92-3f Operational key=0x1 Max delay=0 Aggregate or individual=1 Member Port List=Eth1/39 Eth1/41 Member Port List=Eth1/53 Eth1/54

show lacp system-identifier

show lacp system-identifier

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 lacp system-identifier ",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{
  "ins_api": {
    "type": "cli_show",
    "version": "1.0",
    "sid": "eoc",
    "outputs": {
      "output": {
        "input": "show lacp system-identifier ",
        "msg": "Success",
        "code": "200",
        "body": {
          "system-priority": "32768",
          "system-mac": "2c-d0-2d-50-be-ff"
        }
      }
    }
  }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show lacp system-identifier command, see the CLI command reference:

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

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

CLI Output
Switch# show lacp system-identifier

32768,2c-d0-2d-50-be-ff