[FreeNX-kNX] nxcheckload second

Fabian Franz FabianFranz at gmx.de
Fri Jul 20 11:24:56 UTC 2007


> Hi,
> 
> How do I use nxcheckload. 

nxcheckload will be called for each server that you have in your round robin list once with "$1" as the server as parameter.

It is supposed to return a number, which should somehow be associated with the "load" of the remote machine.

The server with the lowest load is chosen for the session.

In your case setup could be as easy as:

- Create a script and copy it to all servers like:

#!/bin/sh
# numusers.sh

nxserver --list | grep -v Display |grep -v - | grep -v "NX>" | wc -l

Then run it for example with netcat in an endless loop:

netcat -l -p xxxy -e ./numusers.sh

- Your nxcheckload script would then look like:

netcat "$1" xxxy

This is the more general way and just an example setup.

With your changes to --list, you can of course do just return in nxcheckload:

nxserver --list | egrep ^"$1" | grep -v Display |grep -v - | grep -v "NX>" | wc -l

cu

Fabian



More information about the FreeNX-kNX mailing list