networktocode / ntc-templates

TextFSM templates for parsing show commands of network devices
https://ntc-templates.readthedocs.io/
Other
1.08k stars 707 forks source link

cisco_nxos_show_version.textfsm updated to get BIOS version #1686

Closed i-m-d closed 1 month ago

i-m-d commented 4 months ago

Added support for getting BIOS version.

Tested in Nexus 3048, 93xx, 92xx and several versions (6.x, 7.x, 9.x and 10.x)

Lines added: Value BIOS (\d+.\d+(.+)?) ^\s+(BIOS:\s+version)\s+${BIOS}\s*$$

Templete complete: 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 ^\s+cisco\s+Nexus\d+\s+${PLATFORM}

Cisco N5K platform

^\s+cisco\s+Nexus\s+${PLATFORM}\s+[cC]hassis ^\s+Device\s+name:\s+${HOSTNAME}$$ ^\s+cisco\s+.+-${PLATFORM}\s*

Nexus intel platform uses Board ID as serial/license

^\s*Processor\s[Bb]oard\sID\s+${SERIAL}$$ ^Kernel\s+uptime\s+is\s+${UPTIME} ^\s+Reason:\s${LAST_REBOOT_REASON} -> Record

ryanmerolle commented 2 months ago

Why not try a PR?

mjbear commented 1 month ago

@i-m-d Ryan is suggesting you could submit your own PR these changes. Are you open to doing that?

i-m-d commented 1 month ago

I could try, but i really do not know how. I have several templates modified as i required extra fields not supported by oficial template. Is there a how to or similar ?

mjbear commented 1 month ago

@i-m-d Yes, there are docs for creating templates and for the development environment. (main location for development docs: https://github.com/networktocode/ntc-templates/tree/master/docs/dev)

(To be clear I'm a volunteer.) NTC's policy on new templates or adding data to templates is a question of necessity (read it verbatim at the previous hyperlink). I can certainly understand the reasoning, including toward that of the maintainers.

If you're fine with "learning to fish", running the project tests, and submitting your own PR that's great. It's handy to have another community member to pitch in. :wink:

(Otherwise I see personal value [below] in this so I could toss in the ounce of time later today to work things up and submit a PR. You decide and if you choose not to submit a PR, please respond letting me know.)

Situations like this for example:

If you are upgrading from Cisco NX-OS Release 7.0(3)I5(2) to Cisco NX-OS Release 9.3(x) using the install all command, BIOS will not be upgraded due to CSCve24965. When the upgrade to Cisco NX-OS Release 9.3(x) is complete, use the install all command again to complete the BIOS upgrade, if applicable. https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/93x/upgrade/guide/b-cisco-nexus-9000-nx-os-software-upgrade-downgrade-guide-93x/b-cisco-nexus-9000-nx-os-software-upgrade-downgrade-guide-93x_chapter_0111.html

mjbear commented 1 month ago

@i-m-d Also, if you feel you want to contribute and/or the changes would be beneficial to others, open up an issue ticket per template so the NTC and the community can provide feedback.

i-m-d commented 1 month ago

thanks @mjbear, i will read docs but my time is very limited, maybe if you submit this template i can see how the process is faster thant read all the docs and try myself.

I have other templates modifications even some new ones.

mjbear commented 1 month ago

Hello @i-m-d There are certain sections of the docs that will be more important than others.

I have no issues submitting this, but running the test cases before submitting a PR is something that others don't see.

I worked up PR #1778