[GE users] [GE dev] Load sensor scripts

Magnus Söderberg magnus.soderberg at switchcore.com
Wed Aug 18 08:00:39 BST 2004

    [ The following text is in the "ISO-8859-1" character set. ]
    [ Your display is set for the "ISO-8859-10" character set.  ]
    [ Some special characters may be displayed incorrectly. ]


Although I don't know if it may contribute to your problem, it might be a good idea to 
move the calculation of the load value to the start of the script, then wait for input and 
return the value. The reason is that the script might be too slow to work with SGE otherwise.
Checking the number of logins shouldn't be a big deal of course, but I had a problem with 
a perl-script checking for license consumption on a FlexLM server. It worked perfectly 
when I ran it manually to check, but failed when SGE ran it because of the delay when 
parsing FLexLM output.
Took me a while to figure out.

Dev wrote:
>>>This is what I have done
>>>created a shell script
>>>myhost=`uname -n`
>>>while [ 1 ]; do
>>>    # wait for input
>>>    read input
>>>    result=$?
>>>    if [ $result != 0 ]; then
>>>         exit 1
>>>    fi
>>>    if [ $input = "quit" ]; then
>>>         exit 0
>>>    fi
>>>    #send users logged in
>>>    logins=`who -q | tail -1 | cut -d = -f 2`    <<--- move this line up
>>>    echo begin
>>>    echo "$myhost:ge_load:$logins"
>>>    echo end
>>># we never get here
>>>exit 0


Magnus Söderberg, M.Sc.E.E.
Staff Engineer
SwitchCore AB        Phone +46 46 2702560
Emdalavägen 18       Fax   +46 46 2702581
SE-223 69 Lund, Sweden

To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net

More information about the gridengine-users mailing list