Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support to Try Multiple Commands #198

Open
susanhooks opened this issue Jun 27, 2024 · 3 comments
Open

Add Support to Try Multiple Commands #198

susanhooks opened this issue Jun 27, 2024 · 3 comments
Labels
type: feature Introduction of substantial new functionality to the application

Comments

@susanhooks
Copy link
Contributor

Environment

  • Nautobot version: <2.2.3>
  • nautobot-device-onboarding version: <4.0.1rc2->

Proposed Functionality

Use Case

Ability to onboard more devices with unique command structures.

@steve-hodgkiss
Copy link

Agree - show version on Cisco devices should provide information but it's fairly unstructured text. show inventory provides a much better formatted dump of information based on PID: and SN: and will be useful for pulling line card info on larger chassis (and clustered systems).

@jeffkala
Copy link
Contributor

The key element to this is to know when/what constitutes a "passing" condition. If you try multiple commands and the commands and/jmespath render an actual result, should you continue? stop? etc. My initial thought when I was writing the yaml file was to implement a "validator_pattern" of sorts.

  serial:
    commands:
      - command: "show version"
        parser: "textfsm"
        jpath: "[*].serial_number"
      - command: "show inventory"
        parser: "textfsm"
        jpath: "[*].serial_number"
    validator_pattern: <maybe a function/regex/other>

Where if the first command is tried/parsed, if the post-processed data doesn't match the validator pattern it moves on to the next command.

@smk4664 smk4664 added type: feature Introduction of substantial new functionality to the application and removed type: minor feature labels Feb 14, 2025
@steve-hodgkiss
Copy link

Adding to this - Cisco devices have multiple serial numbers displayed in the show version command and it looks like you're picking up the first (and wrong according to Cisco) serial number. Sample command output from a stacking switch

Motherboard Assembly Number        : 4C57
Motherboard Serial Number          : FXS123456DR
Model Revision Number              : V02
Motherboard Revision Number        : 3
Model Number                       : C9606R
System Serial Number               : FXS1234Q2CJ
 
Switch 01
---------
Motherboard Assembly Number        : 4C57
Motherboard Serial Number          : FXS1234567L
Model Revision Number              : V02
Motherboard Revision Number        : 3
Model Number                       : C9606R
System Serial Number               : FXS1234Q2W3

Show ver displays the "processor board ID" which is more likely to be the correct serial number but really show inventory is what you want to be using to make like easier all round. Sample output from a stackable switch below. The first entry is the main PID with the serial number Cisco is expecting

switch#show inventory
NAME: "Switch 1 Chassis", DESCR: "Cisco Catalyst 9600 Series 6 Slot Chassis"
PID: C9606R            , VID: V01  , SN: FXS1234Q2W3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Introduction of substantial new functionality to the application
Projects
None yet
Development

No branches or pull requests

5 participants