For Programmers: Free Programming Magazines  


Home > Archive > Tcl > April 2007 > accessing tcl/tk GUIs for AIX/Linux RHEL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author accessing tcl/tk GUIs for AIX/Linux RHEL
lookie

2007-04-23, 4:15 am

Hi all,

We have a suite of ksh scripts that manages our databases in each of
our servers. These scripts were created to replace an old badly-
written, harcoded c program which did the database management for
us.Our servers typically runs either AIX or Linux RHEL. For the
scripts, we had a script which gives a simple text-based menu that
calls up the other scripts needed to do the respective actions.
Typically to run these scripts on the servers, we'll ssh to the
respective servers and run the script(s).

Now, what we need is to have a user interface that is more
"intuitive". The users and management do not want anyone to
accidentally shut down a database because they accidentally pressed
the x key or anything like that. After doing some searching, i find
that tcl/tk or perl/tk looks to suit our purpose just fine. I do have
a questions to which i can't find the answer, most probably due to the
fact that its trivial or blindingly obvious:

1) can we still ssh to the server via putty for instance, run the
tcl/tk interface script and have the widgets/GUIs run and call the
necessary korn shell files? (I'm still struggling to grasp a mental
picture of a GUI on what have predominantly been a CLI environment for
the servers i work on)

2) Are there any other things to consider?

Any help and suggestions greatly appreciated.

M. Strobel

2007-04-23, 4:15 am

lookie schrieb:
> Hi all,
>
> We have a suite of ksh scripts that manages our databases in each of
> our servers. These scripts were created to replace an old badly-
> written, harcoded c program which did the database management for
> us.Our servers typically runs either AIX or Linux RHEL. For the
> scripts, we had a script which gives a simple text-based menu that
> calls up the other scripts needed to do the respective actions.
> Typically to run these scripts on the servers, we'll ssh to the
> respective servers and run the script(s).
>
> Now, what we need is to have a user interface that is more
> "intuitive". The users and management do not want anyone to
> accidentally shut down a database because they accidentally pressed
> the x key or anything like that. After doing some searching, i find
> that tcl/tk or perl/tk looks to suit our purpose just fine. I do have
> a questions to which i can't find the answer, most probably due to the
> fact that its trivial or blindingly obvious:
>
> 1) can we still ssh to the server via putty for instance, run the
> tcl/tk interface script and have the widgets/GUIs run and call the
> necessary korn shell files? (I'm still struggling to grasp a mental
> picture of a GUI on what have predominantly been a CLI environment for
> the servers i work on)
>
> 2) Are there any other things to consider?
>
> Any help and suggestions greatly appreciated.
>


Hi,

you have many options here, this is a typical design question.

You can run the GUI on the client (manager station), and issue commands
via ssh to the server.

You can ssh into the server und run your GUI there, tunneling the
display back through ssh (option -X).

BTW, recommended to run Unix/Linux on the manager station, all is much
easier. If the manager runs MS win - you mentioned putty, remote
execution of the GUI is still possible with an X server like Xming.

Here is a tcl example of remote command execution:

#!/usr/bin/env tclsh
# erstellt 2007-04-23 10:15:52 strobel

set loginid user@host.net

# I have automatic (RSA key) login on the server, no password required
if { [catch { exec ssh $loginid ls /home/strobel/DOWNLOAD } res]} {
puts "Error $res"
} else {
puts "Directory Contents on Server: \n$res"
}

# -----


Max
Jeff Hobbs

2007-04-23, 7:08 pm

lookie wrote:
> Now, what we need is to have a user interface that is more
> "intuitive". The users and management do not want anyone to
> accidentally shut down a database because they accidentally pressed
> the x key or anything like that. After doing some searching, i find
> that tcl/tk or perl/tk looks to suit our purpose just fine. I do have
> a questions to which i can't find the answer, most probably due to the
> fact that its trivial or blindingly obvious:
>
> 1) can we still ssh to the server via putty for instance, run the
> tcl/tk interface script and have the widgets/GUIs run and call the
> necessary korn shell files? (I'm still struggling to grasp a mental
> picture of a GUI on what have predominantly been a CLI environment for
> the servers i work on)


Yes, you can create a Tcl/Tk GUI that runs on the machine you are ssh'd
into, but you would have to have a remote X11 server to direct the user
interface to (any unix machine, or Windows with X-Windows server such as
Exceed, X-Win32 or cygwin). You will see the UI locally, but all
actions will occur on the remote machine.

> 2) Are there any other things to consider?


Just install Tcl/Tk and try it out. You can get up-to-date binaries
with a full set of modules via ActiveTcl:
http://www.activestate.com/Tcl

Jeff
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com