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

ssh support #30

Open
mhite opened this issue Aug 20, 2015 · 6 comments
Open

ssh support #30

mhite opened this issue Aug 20, 2015 · 6 comments

Comments

@mhite
Copy link

mhite commented Aug 20, 2015

Would be great if netconify could initiate connections to a console server via ssh rather than just telnet. Our entire console server infrastructure relies on ssh to reach console ports rather than telnet.

Thanks for your consideration.

@r2600r
Copy link
Contributor

r2600r commented Sep 1, 2015

I just added the ssh support. It is in first stages and needs little finishing touches and then I'll request merge to this official library. For time being, you can pull mine on you own risk.

pbk@pbk-mbp15 [~]netconify --facts -s "146.180.226.36,4011,," -u test-user --passwd "pasword1"
CMD:TTY:login:connecting to TTY:146.180.226.36:4011:test-user:password1 ...
CMD:TTY:login:logging to device ...
CMD:TTY:login: OK ... starting NETCONF
CMD:facts:retrieving device facts...
CMD:facts:saving: ./cfwj-lab1-0011a-facts.json
CMD:inventory:saving: ./cfwj-lab1-0011a-inventory.xml
CMD:TTY:logout:logging out ...

I omitted ssh console user and pass, since they're same for device authentication, but if they are different, you can specify them.

pbk@pbk-mbp15 [~]netconify --facts -s "146.180.226.36,4011,console-user,console-password" -u test-user --passwd "pasword1"
CMD:TTY:login:connecting to TTY:146.180.226.36:4011:console-user:console-password ...
CMD:TTY:login:logging to device ...

@tomehb
Copy link

tomehb commented Apr 14, 2016

r2600,, I get the following:

`MAC:~$netconify --facts --ssh=10.0.0.8,3020,terminalUsername,terminalPassword -u username --passwd "junosPassword?"
TTY:connecting to TTY:10.0.0.8:3020: terminalUsername: terminalPassword ...
TTY:logging in ...
ERROR:login:global name 'time' is not defined

Traceback (most recent call last):
File "/usr/local/bin/netconify", line 7, in
results = nc.run()
File "/usr/local/lib/python2.7/site-packages/netconify/cmdo.py", line 253, in run
self._hook_exception('login', err)
File "/usr/local/lib/python2.7/site-packages/netconify/cmdo.py", line 251, in run
self._tty_login()
File "/usr/local/lib/python2.7/site-packages/netconify/cmdo.py", line 337, in _tty_login
self._tty.login(notify=notify)
File "/usr/local/lib/python2.7/site-packages/netconify/tty.py", line 109, in login
self._login_state_machine()
File "/usr/local/lib/python2.7/site-packages/netconify/tty.py", line 166, in _login_state_machine
prompt, found = self.read_prompt()
File "/usr/local/lib/python2.7/site-packages/netconify/tty_ssh.py", line 97, in read_prompt
delta = time.time() - start
NameError: global name 'time' is not defined

`

@jeffbrl
Copy link

jeffbrl commented Jun 30, 2016

I noted some problems with tty_ssh.py in issue #50. Trying cloning my fork.

sudo pip install git+https://github.com/jeffbrl/py-junos-netconify.git@issue-50-fix

@gsram369
Copy link

gsram369 commented Jul 1, 2016

jeffbri i tried cloning your fork unfortunately it didnt work

@jeffbrl
Copy link

jeffbrl commented Jul 1, 2016

Not sure what error you encountered. Try cloning my fork with 'git clone' and then switching to the issue-50-fix branch. Run 'python setup.py install'.

@r2600r
Copy link
Contributor

r2600r commented Jul 4, 2016

Jeff,
The issue with #50 is purely decorative, allot does is negate timeout that wasn't in netconify before and was added to actually timeout. Thanks for noticing calling incorrect variable but this simple loop can be done 100 different ways to achieve same result. It was written quickly to satisfy customer request. I'll pick up work on netconify this summer and add more features users require.

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

No branches or pull requests

5 participants