show version
show version
import requests
import json
"""
Modify these please
"""
url='http://<ip_address>:<port_number>/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 version",
"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)
json_output = json.loads(output)["ins_api"]["outputs"]["output"]["body"]
print(json.dumps(json_output, indent=4, sort_keys=True))
{
"bios_cmpl_time": "09/25/2019",
"bios_ver_str": "0.16.0",
"bootflash_size": 3833856,
"chassis_id": "MDS 9148T 48X32G FC (1 RU) Chassis",
"cpu_name": "Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz",
"header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nDocuments: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html\nCopyright (c) 2002-2020, Cisco Systems, Inc. All rights reserved.\nThe copyrights to certain works contained herein are owned by\nother third parties and are used and distributed under license.\nSome parts of this software are covered under the GNU Public\nLicense. A copy of the license is available at\nhttp://www.gnu.org/licenses/gpl.html.\n",
"host_name": "test-switch",
"isan_cmpl_time": " 7/11/2020 12:00:00",
"isan_file_name": "bootflash:///m9148-s6ek9-mz.8.4(2a).bin",
"isan_tmstmp": "06/17/2020 17:16:13",
"kern_uptm_days": 0,
"kern_uptm_hrs": 3,
"kern_uptm_mins": 26,
"kern_uptm_secs": 41,
"kick_cmpl_time": " 7/11/2020 12:00:00",
"kick_file_name": "bootflash:///m9148-s6ek9-kickstart-mz.8.4(2a).bin",
"kick_tmstmp": "06/17/2020 15:45:45",
"kickstart_ver_str": "8.4(2a)",
"loader_ver_str": "N/A",
"manufacturer": "Cisco Systems, Inc.",
"mem_type": "kB",
"memory": 5752572,
"module_id": "4/8/16/32 Gbps FC/Sup-4",
"proc_board_id": "JAE2151022Y",
"rr_ctime": "Wed Jun 26 17:49:03 2019",
"rr_reason": "Reset Requested by CLI command reload",
"rr_service": "",
"rr_sys_ver": "8.4(2a)",
"rr_usecs": 234389,
"sys_ver_str": "8.4(2a)"
}
<header_str>Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html
Copyright (c) 2002-2020, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained herein are owned by
other third parties and are used and distributed under license.
Some parts of this software are covered under the GNU Public
License. A copy of the license is available at
http://www.gnu.org/licenses/gpl.html.
</header_str>
<bios_ver_str>0.16.0</bios_ver_str>
<loader_ver_str>N/A</loader_ver_str>
<kickstart_ver_str>8.4(2a)</kickstart_ver_str>
<sys_ver_str>8.4(2a)</sys_ver_str>
<bios_cmpl_time>09/25/2019</bios_cmpl_time>
<kick_file_name>bootflash:///m9148-s6ek9-kickstart-mz.8.4(2a).bin</kick_file_name>
<kick_cmpl_time> 7/11/2020 12:00:00</kick_cmpl_time>
<kick_tmstmp>06/17/2020 15:45:45</kick_tmstmp>
<isan_file_name>bootflash:///m9148-s6ek9-mz.8.4(2a).bin</isan_file_name>
<isan_cmpl_time> 7/11/2020 12:00:00</isan_cmpl_time>
<isan_tmstmp>06/17/2020 17:16:13</isan_tmstmp>
<chassis_id>MDS 9148T 48X32G FC (1 RU) Chassis</chassis_id>
<module_id>4/8/16/32 Gbps FC/Sup-4</module_id>
<cpu_name>Intel(R) Xeon(R) CPU D-1530 @ 2.40GHz</cpu_name>
<memory>5752572</memory>
<mem_type>kB</mem_type>
<proc_board_id>JAE2151022Y</proc_board_id>
<host_name>test-switch</host_name>
<bootflash_size>3833856</bootflash_size>
<kern_uptm_days>0</kern_uptm_days>
<kern_uptm_hrs>3</kern_uptm_hrs>
<kern_uptm_mins>26</kern_uptm_mins>
<kern_uptm_secs>41</kern_uptm_secs>
<rr_usecs>234389</rr_usecs>
<rr_ctime>Wed Jun 26 17:49:03 2019</rr_ctime>
<rr_reason>Reset Requested by CLI command reload</rr_reason>
<rr_sys_ver>8.4(2a)</rr_sys_ver>
<rr_service/>
<manufacturer>Cisco Systems, Inc.</manufacturer>
The show version
command displays the version of system software that is currently running on the switch.
For command descriptions, see the Cisco MDS 9000 Series Switches Command References.
Note: This sample output is generated for Cisco MDS 9000 Series NX-OS Release 8.4(2a) or later.
CLI Output |
---|
|
Parameter | Description | Type |
---|---|---|
kern_uptm_hrs | Kernel up time, in hours | Integer |
kern_uptm_secs | Kernel up time, in seconds | Integer |
bootflash_size | Bootflash size, in kilobyte | Integer |
cpu_name | CPU name | String |
slot0_size | Slot0 size, in kilobyte | Integer |
kick_file_name | Kickstart image file name | String |
rr_usecs | Last reset time, in microseconds | Integer |
header_str | Version header | String |
sys_ver_str | System image version | String |
kern_uptm_days | Kernel up time, in days | Integer |
rr_sys_ver | System version on last reset | String |
kickstart_ver_str | Kickstart image version | String |
module_id | Module ID | String |
isan_file_name | System image file name | String |
kern_uptm_mins | Kernel up time, in minutes | Integer |
bios_ver_str | BIOS version | String |
memory | Memory size | Integer |
rr_reason | Last reset reason | String |
rr_service | Service name that is causing the reset | String |
proc_board_id | Processor board ID | String |
mem_type | Memory type | String |
host_name | Device name | String |
chassis_id | System chassis ID | String |
kick_cmpl_time | Kickstart image compile time (in MM/dd/yyyy HH:mm:ss) | String |
isan_cmpl_time | System image compile time in the format MM/dd/yyyy HH:mm:ss | String |
kick_tmstmp | Kickstart image file timestamp in the format MM/dd/yyyy HH:mm:ss | String |
isan_tmstmp | System image file timestamp in the format MM/dd/yyyy HH:mm:ss | String |
bios_cmpl_time | BIOS compile time in the format MM/dd/yyyy | String |
rr_ctime | Last reset time and date in the format ddd MM dd HH:mm:ss yyyy | String |
loader_ver_str | Loader version | String |
manufacturer | Manufacturer name | String |