Luca Brasi wrote:I was wondering how you guys run things.
Do you add the host in your Autostart and have it run/connected all the time or do you add and delete the host for any command you issue to the ssh box?
The plugin is designed the way that you first create a host (e.g. in autostart) and send commands when you need to.
Of course this leads to an always open ssh session, but that shouldn't be an issue.
The Plugin recognises if the host is not available and reconnects as soon as it becomes active again.
The big advantages of keeping the session open are:
-You can pass a series of commands within one session
-It's much faster, as the session doesn't need to be started again
-It has a lot less communication overhead while processing commands, as the session doesn't need to be started every singel time
Luca Brasi wrote:If so how do you handle the timing? I had to put in some serious waits to get it working like that.
You should split your macro in two:
macro 1: is triggered by your event and only Creates the ssh host
macro 2: is triggered by the "connected" event from the ssh plugin and contains all your ssh commands.
Luca Brasi wrote:Without that I guess the server would kick the connection after its default timeout.
It should reconnect when it's kicked, doesn't it?
Luca Brasi wrote:Oh and if I might add something to the wishlist... it'd be cool to be able to send a series of commands from an action. Maybe a number of commands set in the actions config or from a file. I tried to do it like 'command a; command b; ...' to no avail.
Hmm... No, I don't see the benefit of creating another GUI action for that.
You can write a script that does that very easy:
Code: Select all
commandList=["command a","command b"]
for item in commandList:
eg.plugins.SSH.RunCommand(item, u'host1', False, False, False)