RaamEE
RaamEE

Reputation: 3507

best scripting language\technology to use when building an app that allows to run commands over ssh and via GUI?

For my testing environment I want to build a system that can do what I describe below and I would appreciate your feedback on which scripting language\technology is best for doing so. If you think there is no scripting language suitable for this task, I would appreciate your feedback. I would also appreciate any suggestions on how you would approach my task.

Thanks. RaamEE

Application Description:

  1. Display a GUI that will allow me to select a couple of IPs from a DB Query.
  2. Open several ssh connections to all of the selected IPs.
  3. Allow me to enter a command in the GUI and run it on all machines simultaneously.
  4. Optionally, capture the standard output of the command in each of the ssh connections and display it in the GUI or save in a file.

For example I would like to be able to do the following example:

  1. Query a DB "which IPs are currently available?". Lets say I get 2 IPs
  2. SSH to both IPs simultaneously.
  3. Enter in the GUI the command du -h
  4. Retrieve the Standard output from both SSH connections.
  5. Display the result of the du -h command on each machine.

Upvotes: 1

Views: 333

Answers (3)

glenn jackman
glenn jackman

Reputation: 247012

Tcl/Tk with Expect will meet all your requirements.

Upvotes: 1

gertas
gertas

Reputation: 17145

Check also Parallel SSH, here is article with example: http://www.linux.com/archive/feature/151340 . I hope making GUI for it should be trivial if needed.

Upvotes: 1

ajreal
ajreal

Reputation: 47321

not sure about GUI, it can done quite easily using shell, like

sql="select ip from table"
cmd="du -h"
for ip in $(mysql -u root -ppassword -h host -N <<<$sql);
do
  ssh $ip $cmd > /tmp/$ip.txt
done

ps: make sure is the trust-able user to enter the command

Upvotes: 0

Related Questions