tbotnz / cisshgo Goto Github PK
View Code? Open in Web Editor NEWsimple concurrent ssh server posing as cisco ios
simple concurrent ssh server posing as cisco ios
noticed the return char not coming through when using netmiko
DEBUG:paramiko.transport:userauth is OK
INFO:paramiko.transport:Authentication (password) successful!
DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes
DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes
DEBUG:paramiko.transport:Secsh channel 0 opened.
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok
DEBUG:netmiko:read_channel: cisgo1000v>
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
however if the below used it works
{
"library": "netmiko",
"connection_args": {
"device_type": "cisco_ios",
"host": "10.0.2.15",
"username": "{{device_username}}",
"password": "{{device_password}}",
"port":10039,
"fast_cli":true,
"default_enter":"\r\n"
},
"command": "show ip interface brief",
"queue_strategy": "fifo",
"args":{
"use_textfsm":true
}
}
Goreleaser does an awesome job taking a tag in Master and creating a release with artifacts.
We need to look at also using it to generate the Docker containers and pushing to Dockerhub.
https://goreleaser.com/customization/docker/
Itβs already in the Goreleaser config file, just need to test and try it out!
# uncomment and modify if automated docker build/push is needed
# dockers:
# - goos: linux
# goarch: amd64
# binaries:
# - cisshgo
# image_templates:
# - "hellt/cisshgo:latest"
# - 'hellt/cisshgo:{{ replace .Version "v" ""}}'
# dockerfile: Dockerfile
# skip_push: false
Is there a way to provide different outputs for same command? Example scenario can be
For step 1 and 3 same command will be used but expected response is different.
https://networktocode.slack.com/archives/C019BRL5AKC/p1599191837052900
so there's a regression in that the old code templates the hostname into "show running-config" and "show version" output. So wouldn't be able to point the Netpalm test suite at this until that's back in there. (there's tests that check the running-config, and also the Napalm fact-getter checks show version).
Hi,
Thank you for providing this useful package.
I can't seem to get any command to be returned if I use asyncssh. If I connect manually, it seems to work fine. I have asyncssh working without anything fancy across Cisco's NXOS, Arista, Juniper, Linux and so on. Would you be able to provide any hints as to why this might be happeniing or help me fix this?
The connection succeeds (as per asyncssh logs, and I see the same with cissshgo's output), but the command "show version" just hangs. I'm attaching the debug log from asyncssh if its of some value.
2021-01-12 08:09:35,175 - asyncssh - INFO - Opening SSH connection to localhost, port 10000
2021-01-12 08:09:35,186 - asyncssh - INFO - [conn=0] Connection to localhost, port 10000 succeeded
2021-01-12 08:09:35,186 - asyncssh - INFO - [conn=0] Local address: 127.0.0.1, port 34924
2021-01-12 08:09:35,186 - asyncssh - DEBUG - [conn=0] Requesting key exchange
2021-01-12 08:09:35,187 - asyncssh - DEBUG - [conn=0] Received key exchange request
2021-01-12 08:09:35,192 - asyncssh - DEBUG - [conn=0] Beginning key exchange
2021-01-12 08:09:35,199 - asyncssh - DEBUG - [conn=0] Completed key exchange
2021-01-12 08:09:35,200 - asyncssh - INFO - [conn=0] Beginning auth for user admin
2021-01-12 08:09:35,202 - asyncssh - DEBUG - [conn=0] Trying password auth
2021-01-12 08:09:35,204 - asyncssh - INFO - [conn=0] Auth for user admin succeeded
2021-01-12 08:09:35,204 - suzieq.poller.nodes.node - INFO - Connected to localhost at 1610467775.2045498
2021-01-12 08:09:35,205 - asyncssh - DEBUG - [conn=0, chan=0] Set write buffer limits: low-water=16384, high-water=65536
2021-01-12 08:09:35,205 - asyncssh - INFO - [conn=0, chan=0] Requesting new SSH session
2021-01-12 08:09:35,207 - asyncssh - INFO - [conn=0, chan=0] Command: show version
2021-01-12 08:09:45,217 - suzieq.poller.nodes.node - ERROR - Unable to connect to localhost show version due to timeout
This was talked about briefly in #cisshgo channel on networktocode.slack.com some time ago, but that is now lost to the ages and short scrollback of free slack.
We need to add a license file to this repo to define the license we're using.
https://choosealicense.com/ was what we looked at, I think we wanted to do the Lesser GPL v3:
https://choosealicense.com/licenses/lgpl-3.0/
Permissions
Conditions
Limitations
If you're good with this, I can PR up the LGPL license file.
Hello guys,
First of all, congratulations and thank you for such a wonderful tool!
I am opening a new issue because I have tried to issue the following command: "show interfaces GigabitEthernet2/1" and it does not work. I created the file output and map it at the transcript, but no luck. The output of the log shows the command was issued, however it does not print the output. I tried to escape the "/" or any other workaround, but I cannot make it work. Do you know how this could be solved? I believe it is quite important, since most of the Cisco commands related to interfaces would include that.
Today, there is only one device available in the transcripts, and there is no ability to select a different device.
We need to decide how to start implementing support for different device types, and how to manage/instantiate them.
This will require some thought/planning around the best way to specify a scenario like the following (as an example):
Perhaps the initial configuration simply round-robins through all the devices in transcript_map.yaml and deploys the one of each up to the threshold of maximum listeners?
Is a configuration file specifying the desired topology needed?
@tbotnz and @wrgeorge1983 thoughts?
It should be fairly trivial to introduce a helper function in utils that evaluates any non-matching input against the keys from the FakeDevice[SupportedCommands]
map. This would allow us to not have to have duplicate entries, but to simply search for any string with the most matches from the beginning of the line.
Psuedo-code:
func LongestMatch(input string, SupportedCommands slice) (matched bool, matched_command string):
for command in SupportedCommands:
\\ Do Regex to match start of string against user input
return (matched, matched_command)
We probably need to get up to the v1.0.0 release and start strictly following semvar with any pushes to master. With Go modules this can really bite you in the behind later if you don't start early.
I don't anticipate too many people would be importing our code as a module, vs running the standalone application, but you never know.
I think you should submit this to Cisco Code Exchange
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.