From 5e6c83d51d0f52ecb464f137ad68f0bd1a83f5e4 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 25 Aug 2019 03:31:11 +0200 Subject: Check also if all KaaS nodes have scheduling enabled --- service/check_kaas.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/service/check_kaas.sh b/service/check_kaas.sh index b43acc0..792cf55 100755 --- a/service/check_kaas.sh +++ b/service/check_kaas.sh @@ -25,14 +25,20 @@ if [ -z "$etcd" -o "$etcd" -lt 3 ]; then fi if [ $healthy -ne 0 ]; then - nodes=$(oc get nodes | grep Ready | wc -l) - if [ $nodes -ge $e_nodes ]; then - nodes=" / \${color gray}$etcd etcd, $nodes nodes" + nodes=$(oc get nodes) + ready=$(echo "$nodes" | grep Ready | wc -l) + active=$(echo "$nodes" | grep Ready | grep -vi SchedulingDisabled | wc -l) + if [ $ready -ge $e_nodes ]; then + nodes=" / \${color gray}$etcd etcd, $ready nodes" + if [ $active -ne $ready ]; then + nodes="$nodes ($active active)" + fi else - offline=$(oc get nodes | grep -v "STATUS" | grep -v "Ready" | wc -l) - nodes=" / \${color gray}$etcd etcd, $nodes ready, $offline offline" + echo "$nodes" | grep -v "STATUS" | grep -v "Ready" | awk '{ print $1, $2 }' | sed 's/^/* /' + + offline=$(echo "$nodes" | grep -v "STATUS" | grep -v "Ready" | wc -l) + nodes=" / \${color gray}$etcd etcd, $ready ready, $offline offline" healthy=2 - oc get nodes | grep -v "STATUS" | grep -v "Ready" | awk '{ print $1, $2 }' | sed 's/^/* /' fi fi -- cgit v1.2.1