The best option I have found over the last 6 years is to run a remote web server that supports Tcl based cgi scripting. Currently, I use Apache for both Windows and Unix installations since the code is very similar for the two (you only change the language declaration at the top). I have in the past used IIS on Windows Servers but didn’t care for the painful setup that was required for non-standard cgi scripting languages (i.e. Tcl).
On the Cloverleaf servers I use a Tcl thin client that is triggered by inetd on a specified port. The cgi-scripts in the web server can then communicate with any number of Cloverleaf servers using simple socket communications.
The typical cycle I use goes like this:
user requests cgi url through web server.
cgi script runs in Tcl and opens socket to inetd service on Cloverleaf server.
Inetd service executes Tcl thin client.
cgi script writes a command string to the socket.
Tcl thin client reads command string from the socket, interprets, then executes the command.
Tcl thin client writes command result(s) to socket and waits for next command.
cgi script reads socket and sends next command (incl. quit or exit to terminate the session)
cgi script processes results and writes HTML output to the browser.
This is easily done in Perl as well. While it is possible to do it in ASP.NET it was a real pain when I attempted it.
The nice part about using a Tcl thin client on the Cloverleaf server is you can use other applications besides cgi to interact with the information. For example, I display Cloverleaf server states in my Outlook Today window.
Regardless of how you run the script, the most important thing to know is the MSI extensions in hcitcl. These will allow you to get the statistical information from the shared memory. Make sure you use a catch on the msiAttach, ‘catch {msiAttach}’, when you connect to the shared memory. From there its just list and keyed list processing.
Here’s a little headstart:
catch {msiAttach}
netconfig load
set processList [netcfgGetProcList]
set threadStats [msiGetStatSample $thread]
set threadDef [netcfgGetConnData $thread]
if {![keylget threadStats ALIVE tStatus]} {set tStatus 0}
if {![keylget threadStats PSTATUS pStatus]} {set pStatus “dead”}
…
Here is a link to another thread with a screen shot of what we currently use at HCA for 9 Cloverleaf servers and ~430 sites. http://clovertech.infor.com/viewtopic.php?t=361&highlight=