Closed pwoconnor closed 5 years ago
Yes you can deactivate them
https://pubhub.devnetcloud.com/media/pyats-packages/docs/unicon/user_guide/connection.html
device.connect(init_exec_commands=[], init_config_commands=[])
These will remove all initial command send when connecting.
Thanks jeaubin, but that is for creating pyats connections. My question is specifically about GenieCLI which works off of a yaml file with connection parameters. Now I would assume that I need what you linked, but I am not sure where they would go in the testbed yaml file.
I see;
I'll need to do some test on my side first to make sure it works as expected. I'll be back in the office on Tuesday.
We will release a new version of Unicon to allows this. The planned released is for next Tuesday.
Thanks for reporting it!
Any news on the release for Unicon to alleviate this issue?
Hi Patrick,
We released unicon version 19.4.0 so please upgrade the package and let us know if it solves your issues.
pip install --upgrade unicon
Thanks, Karim
New update does the same thing I reported, when running genie learn, When the session is connected. The program goes straight into config mode and commits various timeout values for line console and line default.
@jeaubin to comment
Hi @pwoconnor , Sorry for the delay, I've done the enhancement, however, there has been some issue with the release. We are currently in Business trip; I'll publish it once we come back, early next week.
Ok thanks for the update!
Hi @jeaubin Do you still plan on releasing this week?
Hi @pwoconnor , it is now released as a beta package!
Sorry for the delay, Here how to get the latest version
pip install unicon --upgrade --pre
(--pre for beta packages)
And here how to set it up in your yaml files
devices:
nx-osv-1:
type: 'router'
os: 'nxos'
alias: 'uut'
tacacs:
login_prompt: "login:"
password_prompt: "Password:"
username: "admin"
passwords:
tacacs: admin
enable: admin
line: admin
connections:
defaults:
class: 'unicon.Unicon'
cli:
protocol: telnet
init_exec_commands: []
init_config_commands: []
ip: "1.1.1.1"
port: 17036
Awesome, Thanks @jeaubin !!! That has resolved my issue. I truly appreciate it!.
So at this, can we run pip install --upgrade unicon, or
we still have to use the beta package and run pip install unicon --upgrade --pre
Thank you so much pwoconnor for bring this issue up.
@theotherswan - Unicon has been released with this enhancement. You can just do
pip install --upgrade unicon
Thank you jeaubin. So with the upgrade we still need to build our testbed file as follow:
devices: nx-osv-1: type: 'router' os: 'nxos' alias: 'uut' tacacs: login_prompt: "login:" password_prompt: "Password:" username: "admin" passwords: tacacs: admin enable: admin line: admin connections: defaults: class: 'unicon.Unicon' cli: protocol: telnet init_exec_commands: [] init_config_commands: [] ip: "1.1.1.1" port: 17036
in order to prevent Genie CLI from changing the device's config, correct? Thank you.
Yes thats correct.
Hi jeaubin, I have about 500 Cisco devices. I can export them from Cisco Prime 3.3 to obtain the following CSV format inventory:
Device FQDN | IP | Device Type device_a.domain | 1.1.1.1 | Cisco Nexus 7700 10-slot device_b.domain | 2.2.2.2 | Cisco Catalyst 6509
Do you have a sample python code to convert this inventory list into a YAML testbed file below?
devices: nx-osv-1: type: 'router' os: 'nxos' alias: 'uut' tacacs: login_prompt: "login:" password_prompt: "Password:" username: "admin" passwords: tacacs: admin enable: admin line: admin connections: defaults: class: 'unicon.Unicon' cli: protocol: ssh init_exec_commands: [] init_config_commands: [] ip: "1.1.1.1" port: 22
I think I would have to convert above Device Type to something Genie CLI would understand (i.e. nxos, ios, etc.). Do you have a link to the official Device Type for all Cisco devices? Thank you so much.
Everytime Genie connects to a IOSXR device it makes configuration changes the line console and line default. Is there a way to turn that feature off?