View Single Post
Old 2005-11-23, 12:39   #8
Thomas11's Avatar
Feb 2003

5·383 Posts

I'm using the following perl script to run LLR on a couple of machines. Perhaps it is of some use for you, Joe. If there isn't a ssh running on your machines, it should also work with the "rsh" command instead of "ssh".

Note the "-B" switch for LLR. It runs LLR in the background, e.g. it works the same way as "nohup llr".
Note also that the way I analyse the output of the uptime command assumes the machines are running for at least one day. For uptime < 1 day the $load variable will contain the wrong data...
And finally note, that you will need some additional script which does the preparation of the input files on your machines. I have some scripts for that purpose, but they assume that the machines have a common home directory. So you'll need to find some other way to handle the input files.

Good luck!


#!/usr/bin/perl -w
# Programm:
# you need to change the following into your machine-names or IPs:
@machines = ("comp1", "comp2", "comp3", "comp4");
for ($i=0; $i<=$#machines; $i++)
  $machine = $machines[$i];
# get the load on this specific machine:
  $help = `ssh $machine uptime`;
  @data = split(" ", $help);
  $load = $data[9];
  print "$machine $load\n";
# start LLR if the load is lower than 0.25:
  if ($load < 0.25)
    print "starting LLR at $machine\n";
# you will need to adjust the name of the working directory:
    `ssh $machine "cd ~/llr321/$machine/ && ./llr -B"`;

Last fiddled with by Thomas11 on 2005-11-23 at 12:43
Thomas11 is offline