Help for this page

Select Code to Download


  1. or download this
    @load = split (" ", `cat /proc/loadavg`); # Get loads
    @load = map {substr $_,0,1} @load; # Convert to first digit
    $#load =2; # Truncate array include only loads
    
  2. or download this
    $w = `w`; # run w and store in $w
    $w =~ s/^.*load average:\s+//; # Strip of junk before loads
    @load = split (" ", $w); # split them up
    @load = map {substr $_,0,1} @load; # Convert to first digit
    $#load =2; # Truncate array include only loads