show hardware

show hardware

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

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


{

    "ins_api": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_slot": {
                        "ROW_slot": {
                            "TABLE_slot_info": {
                                "ROW_slot_info": [
                                    {
                                        "CLEI_code": "CMMN600ARC", 
                                        "hw_ver": "2.0", 
                                        "manuf_date": "Year 2016 Week 33", 
                                        "model_num": "N9K-C9508", 
                                        "num_slot_str": "2 Supervisor slots, 8 Linecard slots, 6 Fabric slots, 2 System Controller slots\n", 
                                        "part_num": "73-15298-07", 
                                        "part_revision": "A0", 
                                        "serial_num": "FGE20330LWZ", 
                                        "type": "Nexus9000 C9508 (8 Slot) Chassis"
                                    }, 
                                    {
                                        "CLEI_code": "CMUIAP7CAA", 
                                        "hw_ver": "1.1", 
                                        "manuf_date": "Year 2016 Week 39", 
                                        "model_num": "N9K-X9732C-EX", 
                                        "num_submods": "0", 
                                        "part_num": "73-18216-01", 
                                        "part_revision": "B0", 
                                        "serial_num": "SAL2039VA2U", 
                                        "status_ok_empty": "Module1  ok", 
                                        "type": "32x100G Ethernet Module"
                                    }, 
                                    {
                                        "CLEI_code": "CMUIARPCAA", 
                                        "hw_ver": "0.1220", 
                                        "manuf_date": "Year 2016 Week 44", 
                                        "model_num": "N9K-X9732C-EXM", 
                                        "num_submods": "0", 
                                        "part_num": "73-18429-01", 
                                        "part_revision": "22", 
                                        "serial_num": "FOC20444YD2", 
                                        "status_ok_empty": "Module2  ok", 
                                        "type": "32x100G Ethernet Module"
                                    }, 
                                    {
                                        "CLEI_code": "CMUIASCCAA", 
                                        "hw_ver": "0.1110", 
                                        "manuf_date": "Year 2017 Week 24", 
                                        "model_num": "N9K-X9788TC-FX", 
                                        "num_submods": "0", 
                                        "part_num": "73-18690-01", 
                                        "part_revision": "11", 
                                        "serial_num": "FOC21240U8B", 
                                        "status_ok_empty": "Module3  ok", 
                                        "type": "48x10G + 4x40/100G Ethernet Module"
                                    }, 
                                    {
                                        "CLEI_code": "", 
                                        "hw_ver": "0.1120", 
                                        "manuf_date": "Year 2017 Week 7", 
                                        "model_num": "N9K-X9736C-FX", 
                                        "num_submods": "0", 
                                        "part_num": "73-18315-01", 
                                        "part_revision": "12", 
                                        "serial_num": "FOC210707HG", 
                                        "status_ok_empty": "Module4  ok", 
                                        "type": "36x40/100G Ethernet Module"
                                    }, 
                                    {
                                        "status_ok_empty": "Module5  empty"
                                    }, 
                                    {
                                        "status_ok_empty": "Module6  empty"
                                    }, 
                                    {
                                        "status_ok_empty": "Module7  empty"
                                    }, 
                                    {
                                        "status_ok_empty": "Module8  empty"
                                    }, 
                                    {
                                        "status_ok_empty": "FM21  empty"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAJJBAA", 
                                        "hw_ver": "1.1", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-C9508-FM-E", 
                                        "num_submods": "0", 
                                        "part_num": "73-17449-02", 
                                        "part_revision": "B0", 
                                        "serial_num": "SAL2035URFY", 
                                        "status_ok_empty": "FM22  ok", 
                                        "type": "8-slot Fabric Module"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAJJBAA", 
                                        "hw_ver": "1.1", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-C9508-FM-E", 
                                        "num_submods": "0", 
                                        "part_num": "73-17449-02", 
                                        "part_revision": "B0", 
                                        "serial_num": "SAL2035UUN3", 
                                        "status_ok_empty": "FM23  powered-dn", 
                                        "type": "8-slot Fabric Module"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAJJBAA", 
                                        "hw_ver": "1.1", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-C9508-FM-E", 
                                        "num_submods": "0", 
                                        "part_num": "73-17449-02", 
                                        "part_revision": "B0", 
                                        "serial_num": "SAL2035URF2", 
                                        "status_ok_empty": "FM24  ok", 
                                        "type": "8-slot Fabric Module"
                                    }, 
                                    {
                                        "status_ok_empty": "FM25  empty"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAJJBAA", 
                                        "hw_ver": "1.1", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-C9508-FM-E", 
                                        "num_submods": "0", 
                                        "part_num": "73-17449-02", 
                                        "part_revision": "B0", 
                                        "serial_num": "SAL2035URFP", 
                                        "status_ok_empty": "FM26  ok", 
                                        "type": "8-slot Fabric Module"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAE2BAC", 
                                        "hw_ver": "1.0", 
                                        "manuf_date": "Year 2016 Week 15", 
                                        "model_num": "N9K-SUP-A", 
                                        "num_submods": "0", 
                                        "part_num": "73-15279-06", 
                                        "part_revision": "A0", 
                                        "serial_num": "SAL2015NQ3H", 
                                        "status_ok_empty": "Module27  ok", 
                                        "type": "Supervisor Module"
                                    }, 
                                    {
                                        "status_ok_empty": "Module28  empty"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAEZBAA", 
                                        "hw_ver": "1.6", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-SC-A", 
                                        "num_submods": "0", 
                                        "part_num": "73-15294-02", 
                                        "part_revision": "G0", 
                                        "serial_num": "SAL2035UTLL", 
                                        "status_ok_empty": "Module29  ok", 
                                        "type": "System Controller"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAEZBAA", 
                                        "hw_ver": "1.6", 
                                        "manuf_date": "Year 2016 Week 35", 
                                        "model_num": "N9K-SC-A", 
                                        "num_slot_str": "8 PowerSupply Slots", 
                                        "num_submods": "0", 
                                        "part_num": "73-15294-02", 
                                        "part_revision": "G0", 
                                        "serial_num": "SAL2035UTK8", 
                                        "status_ok_empty": "Module30  ok", 
                                        "type": "System Controller"
                                    }, 
                                    {
                                        "CLEI_code": "CMUPACMCAB", 
                                        "hw_ver": "2.0", 
                                        "manuf_date": "Year 2015 Week 2", 
                                        "model_num": "N9K-PAC-3000W-B", 
                                        "part_num": "341-0580-02", 
                                        "part_revision": "A0", 
                                        "serial_num": "DTM190203NX", 
                                        "status_ok_empty": "PS1 ok", 
                                        "type": "3000.00W 220v AC"
                                    }, 
                                    {
                                        "CLEI_code": "CMUPACMCAB", 
                                        "hw_ver": "2.2", 
                                        "manuf_date": "Year 2016 Week 31", 
                                        "model_num": "N9K-PAC-3000W-B", 
                                        "part_num": "341-0580-02", 
                                        "part_revision": "C0", 
                                        "serial_num": "ART2031F6NX", 
                                        "status_ok_empty": "PS2 ok", 
                                        "type": "3000.00W 220v AC"
                                    }, 
                                    {
                                        "CLEI_code": "CMUPACMCAB", 
                                        "hw_ver": "2.2", 
                                        "manuf_date": "Year 2016 Week 31", 
                                        "model_num": "N9K-PAC-3000W-B", 
                                        "part_num": "341-0580-02", 
                                        "part_revision": "C0", 
                                        "serial_num": "ART2031F6NV", 
                                        "status_ok_empty": "PS3 ok", 
                                        "type": "3000.00W 220v AC"
                                    }, 
                                    {
                                        "status_ok_empty": "PS4 absent"
                                    }, 
                                    {
                                        "status_ok_empty": "PS5 absent"
                                    }, 
                                    {
                                        "status_ok_empty": "PS6 absent"
                                    }, 
                                    {
                                        "status_ok_empty": "PS7 absent"
                                    }, 
                                    {
                                        "num_slot_str": "3 Fan slots", 
                                        "status_ok_empty": "PS8 absent"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAE1BAA", 
                                        "hw_ver": "1.0", 
                                        "manuf_date": "Year 2016 Week 19", 
                                        "model_num": "N9K-C9508-FAN", 
                                        "part_num": "73-15289-06", 
                                        "part_revision": "B0", 
                                        "serial_num": "FGE201909AE", 
                                        "status_ok_empty": "Fan1 ok"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAE1BAA", 
                                        "hw_ver": "1.0", 
                                        "manuf_date": "Year 2016 Week 19", 
                                        "model_num": "N9K-C9508-FAN", 
                                        "part_num": "73-15289-06", 
                                        "part_revision": "B0", 
                                        "serial_num": "FGE20190980", 
                                        "status_ok_empty": "Fan2 ok"
                                    }, 
                                    {
                                        "CLEI_code": "CMUCAE1BAA", 
                                        "hw_ver": "1.0", 
                                        "manuf_date": "Year 2016 Week 19", 
                                        "model_num": "N9K-C9508-FAN", 
                                        "part_num": "73-15289-06", 
                                        "part_revision": "B0", 
                                        "serial_num": "FGE201909AJ", 
                                        "status_ok_empty": "Fan3 ok"
                                    }
                                ]
                            }
                        }
                    }, 
                    "bios_cmpl_time": "10/18/2016", 
                    "bios_ver_str": "08.32", 
                    "bootflash_size": 21693714, 
                    "chassis_id": "Nexus9000 C9508 (8 Slot) Chassis", 
                    "cpu_name": "Intel(R) Xeon(R) CPU E5-2403 0 @ 1.80GHz", 
                    "header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nCopyright (C) 2002-2018, Cisco and/or its affiliates.\nAll rights reserved.\nThe copyrights to certain works contained in this software are\nowned by other third parties and used and distributed under their own\nlicenses, such as open source.  This software is provided \"as is,\" and unless\notherwise stated, there is no warranty, express or implied, including but not\nlimited to warranties of merchantability and fitness for a particular purpose.\nCertain components of this software are licensed under\nthe GNU General Public License (GPL) version 2.0 or \nGNU General Public License (GPL) version 3.0  or the GNU\nLesser General Public License (LGPL) Version 2.1 or \nLesser General Public License (LGPL) Version 2.0. \nA copy of each such license is available at\nhttp://www.opensource.org/licenses/gpl-2.0.php and\nhttp://opensource.org/licenses/gpl-3.0.html and\nhttp://www.opensource.org/licenses/lgpl-2.1.php and\nhttp://www.gnu.org/licenses/old-licenses/library.txt.\n", 
                    "host_name": "macsec2", 
                    "kern_uptm_days": 0, 
                    "kern_uptm_hrs": 5, 
                    "kern_uptm_mins": 3, 
                    "kern_uptm_secs": 28, 
                    "kick_cmpl_time": " 5/22/2018 15:00:00", 
                    "kick_file_name": "bootflash:///nxos.7.0.3.I7.4.bin", 
                    "kick_tmstmp": "05/22/2018 15:26:08", 
                    "kickstart_ver_str": "7.0(3)I7(4)", 
                    "manufacturer": "Cisco Systems, Inc.", 
                    "mem_type": "kB", 
                    "memory": 16400780, 
                    "module_id": "Supervisor Module", 
                    "proc_board_id": "SAL2015NQ3H", 
                    "rr_ctime": 1527099972, 
                    "rr_reason": "Reset Requested by CLI command reload", 
                    "rr_service": "", 
                    "rr_sys_ver": "7.0(3)I7(4)", 
                    "rr_usecs": 681622
                }, 
                "code": "200", 
                "input": "show hardware", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show hardware 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 7.0(3)I7(4).

CLI Output
Switch# show hardware
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (C) 2002-2018, Cisco and/or its affiliates.
All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under their own
licenses, such as open source.  This software is provided "as is," and unless
otherwise stated, there is no warranty, express or implied, including but not
limited to warranties of merchantability and fitness for a particular purpose.
Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or 
GNU General Public License (GPL) version 3.0  or the GNU
Lesser General Public License (LGPL) Version 2.1 or 
Lesser General Public License (LGPL) Version 2.0. 
A copy of each such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://opensource.org/licenses/gpl-3.0.html and
http://www.opensource.org/licenses/lgpl-2.1.php and
http://www.gnu.org/licenses/old-licenses/library.txt.

Software
  BIOS: version 08.32
  NXOS: version 7.0(3)I7(4)
  BIOS compile time:  10/18/2016
  NXOS image file is: bootflash:///nxos.7.0.3.I7.4.bin
  NXOS compile time:  5/22/2018 15:00:00 [05/22/2018 15:26:08]


Hardware
  cisco Nexus9000 C9508 (8 Slot) Chassis ("Supervisor Module")
  Intel(R) Xeon(R) CPU E5-2403 0 @ 1.80GHz with 16400780 kB of memory.
  Processor Board ID SAL2015NQ3H

  Device name: macsec2
  bootflash:   21693714 kB
Kernel uptime is 0 day(s), 5 hour(s), 3 minute(s), 29 second(s)

Last reset at 681622 usecs after 1527099972
  Reason: Reset Requested by CLI command reload
  System version: 7.0(3)I7(4)
  Service: 

plugin
  Core Plugin, Ethernet Plugin
--------------------------------
Switch hardware ID information
--------------------------------

Switch is booted up
  Switch type is : Nexus9000 C9508 (8 Slot) Chassis
  Model number is N9K-C9508
  H/W version is 2.0
  Part Number is 73-15298-07
  Part Revision is A0
  Manufacture Date is Year 2016 Week 33
  Serial number is FGE20330LWZ
  CLEI code is CMMN600ARC

-------------------------------------
Chassis has 2 Supervisor slots, 8 Linecard slots, 6 Fabric slots, 2 System Controller slots
-------------------------------------
Module1  ok
  Module type is : 32x100G Ethernet Module
  0 submodules are present
  Model number is N9K-X9732C-EX
  H/W version is 1.1
  Part Number is 73-18216-01
  Part Revision is B0
  Manufacture Date is Year 2016 Week 39
  Serial number is SAL2039VA2U
  CLEI code is CMUIAP7CAA

Module2  ok
  Module type is : 32x100G Ethernet Module
  0 submodules are present
  Model number is N9K-X9732C-EXM
  H/W version is 0.1220
  Part Number is 73-18429-01
  Part Revision is 22
  Manufacture Date is Year 2016 Week 44
  Serial number is FOC20444YD2
  CLEI code is CMUIARPCAA

Module3  ok
  Module type is : 48x10G + 4x40/100G Ethernet Module
  0 submodules are present
  Model number is N9K-X9788TC-FX
  H/W version is 0.1110
  Part Number is 73-18690-01
  Part Revision is 11
  Manufacture Date is Year 2017 Week 24
  Serial number is FOC21240U8B
  CLEI code is CMUIASCCAA

Module4  ok
  Module type is : 36x40/100G Ethernet Module
  0 submodules are present
  Model number is N9K-X9736C-FX
  H/W version is 0.1120
  Part Number is 73-18315-01
  Part Revision is 12
  Manufacture Date is Year 2017 Week 7
  Serial number is FOC210707HG
  CLEI code is 

Module5  empty

Module6  empty

Module7  empty

Module8  empty

FM21  empty

FM22  ok
  Module type is : 8-slot Fabric Module
  0 submodules are present
  Model number is N9K-C9508-FM-E
  H/W version is 1.1
  Part Number is 73-17449-02
  Part Revision is B0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035URFY
  CLEI code is CMUCAJJBAA

FM23  powered-dn
  Module type is : 8-slot Fabric Module
  0 submodules are present
  Model number is N9K-C9508-FM-E
  H/W version is 1.1
  Part Number is 73-17449-02
  Part Revision is B0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035UUN3
  CLEI code is CMUCAJJBAA

FM24  ok
  Module type is : 8-slot Fabric Module
  0 submodules are present
  Model number is N9K-C9508-FM-E
  H/W version is 1.1
  Part Number is 73-17449-02
  Part Revision is B0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035URF2
  CLEI code is CMUCAJJBAA

FM25  empty

FM26  ok
  Module type is : 8-slot Fabric Module
  0 submodules are present
  Model number is N9K-C9508-FM-E
  H/W version is 1.1
  Part Number is 73-17449-02
  Part Revision is B0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035URFP
  CLEI code is CMUCAJJBAA

Module27  ok
  Module type is : Supervisor Module
  0 submodules are present
  Model number is N9K-SUP-A
  H/W version is 1.0
  Part Number is 73-15279-06
  Part Revision is A0
  Manufacture Date is Year 2016 Week 15
  Serial number is SAL2015NQ3H
  CLEI code is CMUCAE2BAC

Module28  empty

Module29  ok
  Module type is : System Controller
  0 submodules are present
  Model number is N9K-SC-A
  H/W version is 1.6
  Part Number is 73-15294-02
  Part Revision is G0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035UTLL
  CLEI code is CMUCAEZBAA

Module30  ok
  Module type is : System Controller
  0 submodules are present
  Model number is N9K-SC-A
  H/W version is 1.6
  Part Number is 73-15294-02
  Part Revision is G0
  Manufacture Date is Year 2016 Week 35
  Serial number is SAL2035UTK8
  CLEI code is CMUCAEZBAA

---------------------------------------
Chassis has 8 PowerSupply Slots
---------------------------------------

PS1 ok
  Power supply type is: 3000.00W 220v AC
  Model number is N9K-PAC-3000W-B
  H/W version is 2.0
  Part Number is 341-0580-02
  Part Revision is A0
  Manufacture Date is Year 2015 Week 2
  Serial number is DTM190203NX
  CLEI code is CMUPACMCAB

PS2 ok
  Power supply type is: 3000.00W 220v AC
  Model number is N9K-PAC-3000W-B
  H/W version is 2.2
  Part Number is 341-0580-02
  Part Revision is C0
  Manufacture Date is Year 2016 Week 31
  Serial number is ART2031F6NX
  CLEI code is CMUPACMCAB

PS3 ok
  Power supply type is: 3000.00W 220v AC
  Model number is N9K-PAC-3000W-B
  H/W version is 2.2
  Part Number is 341-0580-02
  Part Revision is C0
  Manufacture Date is Year 2016 Week 31
  Serial number is ART2031F6NV
  CLEI code is CMUPACMCAB

PS4 absent

PS5 absent

PS6 absent

PS7 absent

PS8 absent

----------------------------------
Chassis has 3 Fan slots
----------------------------------

Fan1 ok
  Model number is N9K-C9508-FAN
  H/W version is 1.0
  Part Number is 73-15289-06
  Part Revision is B0
  Manufacture Date is Year 2016 Week 19
  Serial number is FGE201909AE
  CLEI code is CMUCAE1BAA

Fan2 ok
  Model number is N9K-C9508-FAN
  H/W version is 1.0
  Part Number is 73-15289-06
  Part Revision is B0
  Manufacture Date is Year 2016 Week 19
  Serial number is FGE20190980
  CLEI code is CMUCAE1BAA

Fan3 ok
  Model number is N9K-C9508-FAN
  H/W version is 1.0
  Part Number is 73-15289-06
  Part Revision is B0
  Manufacture Date is Year 2016 Week 19
  Serial number is FGE201909AJ
  CLEI code is CMUCAE1BAA