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

Implement support to maintain persistent SSH connections #234

Open
jathanism opened this issue Sep 24, 2015 · 0 comments
Open

Implement support to maintain persistent SSH connections #234

jathanism opened this issue Sep 24, 2015 · 0 comments

Comments

@jathanism
Copy link
Member

This is a common request, which goes something like this:

  1. Connect to a device (or pool of devices)
  2. Run a command
  3. Stay connected
  4. Delay for an interval (say, 60 seconds)
  5. Goto 2

A simple use-case would be to maintain a connection to a device, and to fetch the ARP table (e.g. show arp) every 60 seconds and then "do something with the result". The ideal implementation would be to have this be possible using the trigger.cmds.Commando class.

There isn't really a built-in way to do this with SSH clients in Twisted, but there are some existing patterns for persistent HTTP connections. See:

http://twisted.readthedocs.org/en/latest/web/howto/client.html#http-persistent-connection

Additionally, I did a super hacky and rudimentary proof-of-concept to illustrate that it wouldn't be super hard. Gist here:

https://gist.github.com/jathanism/ea208742882afff89ded

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

2 participants