Skip to content

Commit

Permalink
cisco_nxos show version - add support to capture BIOS version (#1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbear authored Jul 23, 2024
1 parent c34904a commit 0b95f64
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
2 changes: 2 additions & 0 deletions ntc_templates/templates/cisco_nxos_show_version.textfsm
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Value UPTIME ((\d+\s\w+.s.,?\s?){4})
Value LAST_REBOOT_REASON (.+)
Value BIOS (\d+.\d+(.+)?)
Value OS (\d+.\d+(.+)?)
Value BOOT_IMAGE (.*)
Value PLATFORM (\w+)
Value HOSTNAME (.*)
Value SERIAL (\w+)

Start
^\s+(BIOS:\s+version)\s+${BIOS}\s*$$
^\s+(NXOS: version|system:\s+version)\s+${OS}\s*$$
^\s+(NXOS|kickstart)\s+image\s+file\s+is:\s+${BOOT_IMAGE}\s*$$
^\s+cisco\s+${PLATFORM}\s+[cC]hassis
Expand Down
7 changes: 4 additions & 3 deletions tests/cisco_nxos/show_version/cisco_nxos_show_version.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
parsed_sample:
- uptime: "123 day(s), 5 hour(s), 15 minute(s), 19 second(s)"
- bios: "07.15"
boot_image: "bootflash:///n9000-dk9.6.1.2.I3.1.bin"
hostname: "N9K1"
last_reboot_reason: "Unknown"
os: "6.1(2)I3(1)"
boot_image: "bootflash:///n9000-dk9.6.1.2.I3.1.bin"
platform: "C9396PX"
hostname: "N9K1"
serial: "SAL1819S6LU"
uptime: "123 day(s), 5 hour(s), 15 minute(s), 19 second(s)"
7 changes: 4 additions & 3 deletions tests/cisco_nxos/show_version/cisco_nxos_show_version1.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
parsed_sample:
- uptime: "11 day(s), 01 hour(s), 57 minute(s), 02 second(s)"
- bios: "07.64"
boot_image: "/bootflash/aci-n9000-dk9.14.0.1h.bin"
hostname: "Leaf-101"
last_reboot_reason: "unknown"
os: "14.0(1h) [build 14.0(1h)]"
boot_image: "/bootflash/aci-n9000-dk9.14.0.1h.bin"
platform: "C9396PX"
hostname: "Leaf-101"
serial: "SAL1909A8CT"
uptime: "11 day(s), 01 hour(s), 57 minute(s), 02 second(s)"
7 changes: 4 additions & 3 deletions tests/cisco_nxos/show_version/cisco_nxos_show_version2.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
parsed_sample:
- uptime: "749 day(s), 15 hour(s), 17 minute(s), 48 second(s)"
- bios: "3.6.0"
boot_image: "bootflash:///n5000-uk9-kickstart.7.1.4.N1.1.bin"
hostname: "IEDP02-N5K-SW01"
last_reboot_reason: "Disruptive upgrade"
os: "7.1(4)N1(1)"
boot_image: "bootflash:///n5000-uk9-kickstart.7.1.4.N1.1.bin"
platform: "5596"
hostname: "IEDP02-N5K-SW01"
serial: "FOC17153X08"
uptime: "749 day(s), 15 hour(s), 17 minute(s), 48 second(s)"
7 changes: 4 additions & 3 deletions tests/cisco_nxos/show_version/cisco_nxos_show_version3.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
parsed_sample:
- uptime: "311 day(s), 0 hour(s), 27 minute(s), 35 second(s)"
- bios: "3.6.0"
boot_image: "bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin"
hostname: "DC2TESTSW01-55"
last_reboot_reason: "Reset triggered due to HA policy of Reset"
os: "5.2(1)N1(4)"
boot_image: "bootflash:///n5000-uk9-kickstart.5.2.1.N1.4.bin"
platform: "Nexus5548"
hostname: "DC2TESTSW01-55"
serial: "FOC171737PL"
uptime: "311 day(s), 0 hour(s), 27 minute(s), 35 second(s)"
7 changes: 4 additions & 3 deletions tests/cisco_nxos/show_version/cisco_nxos_show_version4.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
parsed_sample:
- uptime: "670 day(s), 6 hour(s), 34 minute(s), 1 second(s)"
- bios: "07.51"
boot_image: "bootflash:///nxos.7.0.3.I4.3.bin"
hostname: "obttestw02"
last_reboot_reason: "Unknown"
os: "7.0(3)I4(3)"
boot_image: "bootflash:///nxos.7.0.3.I4.3.bin"
platform: "C9372PX"
hostname: "obttestw02"
serial: "SAL2211QQWS"
uptime: "670 day(s), 6 hour(s), 34 minute(s), 1 second(s)"

0 comments on commit 0b95f64

Please sign in to comment.