Skip to content

Commit 73edb24

Browse files
committed
Reduce noise on output
1 parent c7b2b19 commit 73edb24

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
@@ -8,7 +8,7 @@ trap "rm ${errorfile}" EXIT
88
echo 0 >$tmperrorfile
99

1010
if oc auth can-i debug node >/dev/null 2>&1; then
11-
msg "Collecting NTP data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
11+
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
1414
# 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
@@ -8,7 +8,7 @@ trap "rm ${errorfile}" EXIT
88
echo 0 >$tmperrorfile
99

1010
if oc auth can-i debug node >/dev/null 2>&1; then
11-
msg "Collecting entropy data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
11+
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
1414
# 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
@@ -18,7 +18,7 @@ trap "rm ${errorfile}" EXIT
1818
echo 0 >$tmperrorfile
1919

2020
if oc auth can-i debug node >/dev/null 2>&1; then
21-
msg "Checking if ports 22623/tcp and 22624/tcp are blocked (${BLUE}using oc debug, it can take a while${NOCOLOR})"
21+
2222
# shellcheck disable=SC2016
2323
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
2424
# 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
@@ -15,7 +15,7 @@ MIN_VERS=16.28
1515

1616
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
1717
if oc auth can-i debug node >/dev/null 2>&1; then
18-
msg "Checking Mellanox firmware version (${BLUE}using oc debug, it can take a while${NOCOLOR})"
18+
output=0
1919
fw_errors=0
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
@@ -31,20 +31,23 @@ if oc auth can-i debug node >/dev/null 2>&1; then
3131
if [[ $(expr ${fw} \< ${MIN_VERS}) -eq 1 ]]; then
3232
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}."
3333
errors=$(("${errors}" + 1))
34+
output=$(("${output}" + 1))
3435
fw_errors=$(("${fw_errors}" + 1))
3536
if [ ! -z "${ERRORFILE}" ]; then
3637
echo $errors >${ERRORFILE}
3738
fi
3839
fi
3940
done
40-
else
41-
msg "Couldn't find Mellanox firmware version in ${node}"
4241
fi
4342
fi
4443
done
4544
if [[ $fw_errors -gt 0 ]]; then
4645
exit ${OCERROR}
4746
fi
47+
if [[ $output -eq 0 ]]; then
48+
echo "No Mellanox cards found"
49+
exit ${OCSKIP}
50+
fi
4851
exit ${OCINFO}
4952
else
5053
msg "Couldn't debug nodes, check permissions"

checks/zombies

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

1010
if oc auth can-i debug node >/dev/null 2>&1; then
11-
msg "Collecting zombie processes... (${BLUE}using oc debug, it can take a while${NOCOLOR})"
11+
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
1414
# 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
@@ -5,7 +5,7 @@
55

66
# Check BIOS version to begin with
77
if oc auth can-i debug node >/dev/null 2>&1; then
8-
msg "Checking bios versions (${BLUE}using oc debug, it can take a while${NOCOLOR})"
8+
99
# shellcheck disable=SC2016
1010
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
1111
# 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
@@ -4,7 +4,7 @@
44
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
55

66
if oc auth can-i debug node >/dev/null 2>&1; then
7-
msg "Checking container images stored in the cluster (${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/ethtool-firmware-version

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

66
if oc auth can-i debug node >/dev/null 2>&1; then
7-
msg "Checking NIC firmware version using ethtool (${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/locks

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

99
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
1010
if oc auth can-i debug node >/dev/null 2>&1; then
11-
msg "Checking for locks by pod, per node (${BLUE}using oc debug, it can take a while${NOCOLOR})"
11+
1212
fw_errors=0
1313
# shellcheck disable=SC2016
1414
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
@@ -26,7 +26,7 @@ if oc auth can-i get network/cluster >/dev/null 2>&1; then
2626
IFS=${OLDIFS}
2727
else
2828
if oc auth can-i debug node -A >/dev/null 2>&1 && oc auth can-i get nodes >/dev/null 2>&1; then
29-
msg "Collecting MTUs... (${BLUE}using oc debug, it can take a while${NOCOLOR}))"
29+
3030
# shellcheck disable=SC2016
3131
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
3232
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691

0 commit comments

Comments
 (0)