Ad Widget

Collapse

Monitoring Linux Cluster usage using ruptime/rwho

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • helixblue
    Junior Member
    • Feb 2005
    • 6

    #1

    Monitoring Linux Cluster usage using ruptime/rwho

    Some more recipes. This will give you the average load of a cluster, given the output of ruptime. The text "bryce" is to match the hostname of the cluster, put your own cluster hostname in there instead. This one I call UserParameter=cluster[avg].

    Code:
    ruptime | perl -e 'while(<>) { if (/bryce.* load ([\d\.]+)/) { 
    $h++; $t+=$1; } } print($t / $h, "\n");'
    Now, if each node has two processors, and you just want the average load of them for percentages, you may want to change the final print() to say $t / $h / 2.

    The following will return the number of unique users logged in to the cluster at the moment:

    Code:
    rwho -a|grep bryce | cut -d " " -f1|sort|uniq | wc -l
    Enjoy!
Working...