home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / perl / 8032 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.1 KB  |  36 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!ukma!gatech!concert!sas!mozart.unx.sas.com!bultman
  3. From: bultman@sonny.unx.sas.com (David Bultman)
  4. Subject: need help with remsh looping UNIX
  5. Originator: bultman@sonny.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <C1Kn61.B1p@unx.sas.com>
  8. Date: Thu, 28 Jan 1993 16:01:12 GMT
  9. Nntp-Posting-Host: sonny.unx.sas.com
  10. Organization: SAS Institute Inc.
  11. Keywords: UNIX remsh infinite loop
  12. Lines: 22
  13.  
  14.  
  15. I have a Perl program that surveys the available servers on
  16. our LAN and by doing a remsh uptime determines which server
  17. has the lowest load average. I use that server to run the 
  18. next job on my job queue. Sometimes the remsh $server uptime hangs.
  19. Is there a way to timeout with Perl? Here's what I have.
  20.  
  21. foreach (@stack) {
  22.    $server = $_;
  23.    chop($server);
  24.    $rc = `remsh $server -n uptime`;  <- could hang here
  25. #  Check to see if this is the lowest
  26. #  and save if yes.
  27. }
  28.  
  29.  
  30.  
  31.  
  32. -- 
  33. David Bultman, bultman@unx.sas.com    SAS Institute, Inc.
  34. Core Research and Development        SAS Campus Dr, Cary, NC
  35. (919) 677-8000 x6875            27513-2414 USA
  36.