Cool Solutions

clustall

neveurnicolas

By:

October 2, 2013 12:00 pm

Reads: 406

Comments:0

License:
Free

Download clustall_0.zip

Bash script to put Online/Offline or Migrate all resources of a cluster at once.

It is not fully idiot proof but it work great ;-)

#!/bin/sh
# 
# Nicolas Neveur from Adaris Technologies
# 
# Usage : Clustall <online/offline/migrate> <nodename>
#

if [ $# != 2 ]
then
	echo "[clustall] USAGE: clustall.sh <online/offline/migrate> <nodename>"
	exit 1
fi
if test $1 == "online" || test $1 == "offline" || test $1 == "migrate"; then
	COMMAND=$1
	NODE=$2
	declare -i COUNT=1
	cluster status | cut -d ' ' -f1 | while read SERVER
		do
			if (( COUNT > 1 )); then
				echo $SERVER : $COMMAND ON $NODE
				cluster $COMMAND $SERVER $NODE >/dev/null
			else
				(( COUNT++ ))
			fi
		done
else
	echo "[clustall] USAGE: clustall.sh <online/offline/migrate> <nodename>"
	exit 1
fi
VN:F [1.9.22_1171]
Rating: 3.0/5 (1 vote cast)
clustall, 3.0 out of 5 based on 1 rating

Tags:
Categories: Cool Tools, Open Enterprise Server, Technical

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

Comment

RSS