diff master/wecu/get_hardware_util.sh @ 57:ac1a20e627a9

from lukasz git repo 2020-05-26 (see ~/src/wecu), then editted, sac not quite working yet
author Henry S. Thompson <ht@markup.co.uk>
date Wed, 27 May 2020 20:54:34 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/master/wecu/get_hardware_util.sh	Wed May 27 20:54:34 2020 +0000
@@ -0,0 +1,12 @@
+seconds=$1
+wait_seconds=$(expr "$1" + "5")
+
+echo $seconds
+echo $wait_seconds
+
+# Get hardware utilisation at each machine 
+parallel --sshloginfile hosts --nonall --jobs 1 --will-cite "rm -f usage_raw.txt usage_cpu.txt"
+parallel --sshloginfile hosts --nonall --jobs 1 --will-cite "iostat -x 1 $seconds > usage_raw.txt &"
+sleep $wait_seconds
+parallel --sshloginfile hosts --onall --jobs 1 --will-cite 'cat usage_raw.txt | grep "avg-cpu" -A 1 | grep -oP "^.*?\d+.\d+\s" | grep -oP {} > usage_cpu.txt' ::: '[\w\.]+'
+cat hosts | xargs -i scp -o "StrictHostKeyChecking no" {}:/home/cc/usage_cpu.txt ./{}.usage.txt