Visitar URL original
Implement support to maintain persistent SSH connections · Issue #234 · trigger/trigger · GitHub
Skip to content

Implement support to maintain persistent SSH connections #234

Open

Description

@jathanism

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions