Commit fecc3208 authored by Haarst, Jan van's avatar Haarst, Jan van
Browse files

Add timeout, and move to lovelace

parent 7d6c0672
#!/bin/bash
# Script to show usage on other machines
echo
echo "Usage on our other machines:"
echo "Hostname LOAD CPU";
echo " CPUs (Procs/Total) [ 1, 5, 15min] [ User, Nice, System, Idle, Wio]";
#gstat -al | sed 's/OFF//'
gstat -al --gmond_ip=$(dig wiki.ab.wurnet.nl +short) | sed '/localhost/,+1 d' | sed 's/OFF//'
# First get info from ganglia
HOST=lovelace.bioinformatics.nl
IP=$(dig $HOST +short | tail -1)
RESULT=$(timeout 0.5 gstat -al --gmond_ip=${IP} | sed '/localhost/,+1 d' | sed 's/OFF//')
IGNORE='bunker|lovelace|scratch'
# If that is successfull, continue with printing the output
if [ -z "$RESULT" ]
then
echo -
else
echo
echo "Usage on our other machines:"
{ echo Hostname,CPUs,Processes_running,Processes_total,load-1m,load-5m,load-15,cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_wio | tr ',' ' ' ;echo "$RESULT" | paste - - | tr '/' ' '| tr ',' ' '| tr -d '[]()' | sort -k8n | grep -vE $IGNORE; } | column -t
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment