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 · 2 comments
Open

Add Support to Try Multiple Commands #198

susanhooks opened this issue Jun 27, 2024 · 2 comments

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants