This is really embarrassing. Around the middle of August I posted a script that worked but just barely. Rpural was good enough to show me how this could be implemented much more elegantly.

Code:
#!/bin/bash -x

# See if the application in question is running and dump output into a text file
#
GKRELLM=$(ps aux|grep gkrellm)
# instead of using a temporary file, dump the output into a variable

# Define some variables representing the ip addresses of the machines I'm testing for
#
ADAMSMDK=192.168.1.100
PVR=192.168.1.103
SHUTTLE=192.168.1.105
SPIKE=192.168.1.106

check() {
        # Check the text file for presence of the ip addresses expected.
        # If present, move on, else, open up a gkrellm instance for that ip address.
        # Do this for each ip address I'm looking for.
        #                                                                                                                                                                    
        echo $GKRELLM | grep -Fq "$1"                                                                                                                                        
        if [ $? -eq 0 ]                                                                                                                                                      
        then echo "found $1 $2"                  # If so, move on, if not start a gkrellm instance                                                                           
        else ssh -p2222 -f -L 19150:${1}:19150 $1 "gkrellm -f -s 127.0.0.1 -P 19150"                                                                                         
        fi                                                                                                                                                                   
}                                                                                                                                                                            
                                                                                                                                                                             
check $ADAMSMDK ADAMSMDK                                                                                                                                                     
check $PVR PVR                                                                                                                                                               
check $SHUTTLE SHUTTLE                                                                                                                                                       
check $SPIKE SPIKE
This works beautifully, but it has a strange side effect. When I run that script it opens gkrellm for the named servers, then it opens a dialog for my password to one of the machines's gkrellm server.



I feed it my password and it opens a second instance of the Gkrellm meter without the expected configuration.



The thing is, for the life of me, I can't figure out what's going on here. Why just that one meter? What's special about that? The configuration for that machine and the Gkrellm server on it is exactly like all the rest, as near as I can tell. I can't even figure out how to troubleshoot this.

Any ideas?

Thanks in advance.