Skip to content

Commit 612416c

Browse files
committed
Reduce noise on output
1 parent be6f778 commit 612416c

File tree

10 files changed

+15
-12
lines changed

10 files changed

+15
-12
lines changed

checks/chronyc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
77
echo 0 >$tmperrorfile
88

99
if oc auth can-i debug node >/dev/null 2>&1; then
10-
msg "Collecting NTP data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
10+
1111
# shellcheck disable=SC2016
1212
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
1313
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

checks/entropy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
77
echo 0 >$tmperrorfile
88

99
if oc auth can-i debug node >/dev/null 2>&1; then
10-
msg "Collecting entropy data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
10+
1111
# shellcheck disable=SC2016
1212
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
1313
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

checks/iptables-22623-22624

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trap "rm ${errorfile}" EXIT
1616
echo 0 >$tmperrorfile
1717

1818
if oc auth can-i debug node >/dev/null 2>&1; then
19-
msg "Checking if ports 22623/tcp and 22624/tcp are blocked (${BLUE}using oc debug, it can take a while${NOCOLOR})"
19+
2020
# shellcheck disable=SC2016
2121
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
2222
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

checks/mellanox-firmware-version

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MIN_VERS=16.28
1414

1515
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
1616
if oc auth can-i debug node >/dev/null 2>&1; then
17-
msg "Checking Mellanox firmware version (${BLUE}using oc debug, it can take a while${NOCOLOR})"
17+
output=1
1818
fw_errors=0
1919
# shellcheck disable=SC2016
2020
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
@@ -30,20 +30,23 @@ if oc auth can-i debug node >/dev/null 2>&1; then
3030
if [[ $(expr ${fw} \< ${MIN_VERS}) -eq 1 ]]; then
3131
msg "Firmware for Mellanox card ${RED}${dev}${NOCOLOR} (${fw}) on ${RED}${node}${NOCOLOR} is below the minimum recommended version. Please upgrade to at least ${GREEN}${MIN_VERS}${NOCOLOR}."
3232
errors=$(("${errors}" + 1))
33+
output=$(("${output}" + 1))
3334
fw_errors=$(("${fw_errors}" + 1))
3435
if [ ! -z "${ERRORFILE}" ]; then
3536
echo $errors >${ERRORFILE}
3637
fi
3738
fi
3839
done
39-
else
40-
msg "Couldn't find Mellanox firmware version in ${node}"
4140
fi
4241
fi
4342
done
4443
if [[ $fw_errors -gt 0 ]]; then
4544
exit ${OCERROR}
4645
fi
46+
if [[ $output -gt 0 ]]; then
47+
echo "No Mellanox cards found"
48+
exit ${OCSKIP}
49+
fi
4750
exit ${OCINFO}
4851
else
4952
msg "Couldn't debug nodes, check permissions"

checks/zombies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
77
echo 0 >$tmperrorfile
88

99
if oc auth can-i debug node >/dev/null 2>&1; then
10-
msg "Collecting zombie processes... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
10+
1111
# shellcheck disable=SC2016
1212
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
1313
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

info/biosversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Check BIOS version to begin with
66
if oc auth can-i debug node >/dev/null 2>&1; then
7-
msg "Checking bios versions (${BLUE}using oc debug, it can take a while${NOCOLOR})"
7+
88
# shellcheck disable=SC2016
99
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
1010
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

info/container-images-stored

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
44

55
if oc auth can-i debug node >/dev/null 2>&1; then
6-
msg "Checking container images stored in the cluster (${BLUE}using oc debug, it can take a while${NOCOLOR})"
6+
77
# shellcheck disable=SC2016
88
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
99
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

info/ethtool-firmware-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
44

55
if oc auth can-i debug node >/dev/null 2>&1; then
6-
msg "Checking NIC firmware version using ethtool (${BLUE}using oc debug, it can take a while${NOCOLOR})"
6+
77
# shellcheck disable=SC2016
88
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
99
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

info/locks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SCRIPT64=$(cat ./scripts/locks.sh | base64 -w 0)
77

88
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
99
if oc auth can-i debug node >/dev/null 2>&1; then
10-
msg "Checking for locks by pod, per node (${BLUE}using oc debug, it can take a while${NOCOLOR})"
10+
1111
fw_errors=0
1212
# shellcheck disable=SC2016
1313
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do

info/mtu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if oc auth can-i get network/cluster >/dev/null 2>&1; then
2525
IFS=${OLDIFS}
2626
else
2727
if oc auth can-i debug node -A >/dev/null 2>&1 && oc auth can-i get nodes >/dev/null 2>&1; then
28-
msg "Collecting MTUs... (${BLUE}using oc debug, it can take a while${NOCOLOR}))"
28+
2929
# shellcheck disable=SC2016
3030
for node in $(oc get nodes -o go-template='{{range .items}}{{$node := .}}{{range .status.conditions}}{{if eq .type "Ready"}}{{if eq .status "True"}}node/{{$node.metadata.name}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}'); do
3131
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

0 commit comments

Comments
 (0)