fi
}
+compatible()
+{
+ compatible="`ssh -q $HOSTNAME 'df --output=pcent /' 2>&1 1>/dev/null`"
+ if [ "$compatible" != "" ]; then
+ echo 0
+ return
+ fi
+ echo 1
+ return
+}
+
# UTILITY FUNCTIONS
###############################################################################
fi
}
+compatible()
+{
+ compatible="`ssh -q $HOSTNAME 'sensors' 2>&1 1>/dev/null`"
+ if [ "$compatible" != "" ]; then
+ echo 0
+ return
+ fi
+ echo 1
+ return
+}
+
# UTILITY FUNCTIONS
###############################################################################
# Check if the monitor is running and echo ON or OFF
}
+compatible()
+{
+ # Check if this plugin is compatible with the given host
+}
+
# SCRIPT START
###############################################################################
fi
# Check what options awk supports
- if [ "`ssh $HOSTNAME \"echo | awk -W interactive '{print 1}' 2>&1 1>/dev/null\"`" != "" ]; then
+ if [ "`ssh -q $HOSTNAME \"echo | awk -W interactive '{print 1}' 2>&1 1>/dev/null\"`" != "" ]; then
awkopt=""
else
awkopt="-W interactive"
fi
ssh -q $HOSTNAME <<EOF
- nohup stdbuf -o0 vmstat $vmopt $DELAY | awk $awkopt -v host=$HOSTNAME 'BEGIN {
+ nohup stdbuf -oL vmstat $vmopt $DELAY | awk $awkopt -v host=$HOSTNAME 'BEGIN {
OFS="|"
}
/us/ {
fi
}
+compatible()
+{
+ compatible="`ssh -q $HOSTNAME 'stdbuf -oL vmstat 5' 2>&1 1>/dev/null`"
+ if [ "$compatible" != "" ]; then
+ echo 0
+ return
+ fi
+ echo 1
+ return
+}
+
# UTILITY FUNCTIONS
###############################################################################
# TODO:
# 1) Finish configure options
# 2) Finish Deploy
+# 3) Review and shakeout stop
# ) Plugins:
-# 3) iostat
-# 4) ram
-# 5) disk utilization
+# 4) iostat
+# 5) ram
#
###############################################################################
# Prompt which host to configure
header "Select a host to configure:"
- host=`selector "Select a host" $hosts "New..." "Done"`
+ host=`selector "Select a host" ${hosts[@]} "New..." "Done"`
if [ "$host" == "New..." ]; then
host=""
elif [ "$host" == "Done" ]; then
newservice=`echo $newservice | sed 's/,$/)/g'`
fi
-set -x
# TODO
# Validate removal/replacement of old service
# TODO