2018-10-23 08:24:50 +00:00
|
|
|
#/bin/bash
|
|
|
|
|
|
|
|
function join_by() {
|
|
|
|
local IFS="$1"; shift; echo "$*";
|
|
|
|
}
|
|
|
|
|
2018-11-23 04:26:30 +00:00
|
|
|
#cx4nodes=( isc17-c0{1..9} isc17-c{10..23} )
|
2018-12-17 09:36:47 +00:00
|
|
|
#cx4nodes=( isc17-c0{1..9} isc17-c{10..18} isc17-c{20..23} )
|
|
|
|
cx4nodes=( c0{1..9} c{10..18} c{20..23} )
|
2018-10-23 08:24:50 +00:00
|
|
|
node_list=$( join_by , "${cx4nodes[@]}" )
|
2018-12-17 09:36:47 +00:00
|
|
|
echo "isc17-c19 is blacklisted (asks for password)"
|
2018-10-23 08:24:50 +00:00
|
|
|
|
|
|
|
IFS='' read -r -d '' script <<"EOF"
|
2018-12-17 09:36:47 +00:00
|
|
|
declare -a reply
|
|
|
|
#if [ ! -d /ime/jtacquaviva ]; then
|
|
|
|
# reply[0]="/ime/ is not mounted"
|
|
|
|
#fi
|
|
|
|
if [ ! -d /gsfs/jtacquaviva ]; then
|
|
|
|
reply[1]="/gsfs/ is not mounted"
|
|
|
|
fi
|
|
|
|
cx4="$(lspci | grep ConnectX-4)"
|
|
|
|
if [[ "" == $cx4 ]]; then
|
|
|
|
reply[2]+="no cx4"
|
2018-10-23 08:24:50 +00:00
|
|
|
fi
|
2018-12-17 09:36:47 +00:00
|
|
|
reply=$(IFS=', '; echo "${reply[*]}")
|
|
|
|
echo "${reply/,/ - }"
|
2018-10-23 08:24:50 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
declare -a good_nodes
|
|
|
|
for node in ${cx4nodes[@]}; do
|
|
|
|
#echo "ping $node"
|
|
|
|
status=$(ping -c1 $node | grep Unreachable)
|
|
|
|
if [[ "" == $status ]]; then
|
|
|
|
check=$(ssh $node "$script")
|
2018-12-17 09:36:47 +00:00
|
|
|
if [[ "" == ${check} ]]; then
|
2018-10-23 08:24:50 +00:00
|
|
|
good_nodes=( ${good_nodes[@]} $node )
|
|
|
|
else
|
|
|
|
echo "$node failed with: $check"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "$node is unreachable"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "GOOD NODES:"
|
|
|
|
echo "${good_nodes[@]}"
|
|
|
|
|
|
|
|
|
|
|
|
|