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].
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:
Enjoy!
Code:
ruptime | perl -e 'while(<>) { if (/bryce.* load ([\d\.]+)/) {
$h++; $t+=$1; } } print($t / $h, "\n");'
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