| " . "MACHINE | "; chop($nowtime); $nowtime =~ s/ .*//g; @oldtimes[$#Machines+1] .= "\t$nowtime\t-->\n"; $secondrow = "||||||||||||||||||||||||
$readings[0]"
. " H" . "$nowtime | ";
$thirdrow = "||||||||||||||||||||||||
| Jobs/CPU | "; for ($i = 0; $i <= $#Machines; $i++) { ($mach, $type) = split(/: /, @Machines[$i]); print NEW "$mach | "; eval { local $SIG{ALRM} = sub { die "DEAD"; }; alarm 20; @output = `/users/an4m/bin/usage $mach 2> /dev/null`; alarm 0; }; if ($@ =~ /DEAD/) { @output[0] = ":0 :0 :0\n"; @output[3] = "Oops! $mach doesn't respond!\n"; } ($junk, $cpu, $load, $total) = split(/ *: */, @output[0]); $back = ($cpu <= 50) ? sprintf("bgcolor=#%02xff00", int(0xff*$cpu/50)) : sprintf("bgcolor=#ff%02x00", 0xff-int(0xff*($cpu-50)/50)); $secondrow .= "";
@times = split(/\s+/, @oldtimes[$i]); shift(@times); pop(@times); shift(@times);
for ($j = $histtimes-$#times-1; $j > 0; $j--) { unshift(@times, "0"); }
for ($j = $#times-$histtimes+1; $j > 0; $j--) { shift(@times); }
@oldtimes[$i] = "\n";
$secondrow .= " | ";
$thirdrow .= "$load/$total | "; shift(@output); shift(@output); shift(@output); push(@appendage, "|||||||||||||||||||||
"
. "" . "$mach$type |
|
| ||||||||||||||||||
|