Skip to content

Commit

Permalink
Reduce noise on output
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Nov 16, 2022
1 parent be6f778 commit 612416c
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion checks/chronyc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
echo 0 >$tmperrorfile

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Collecting NTP data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion checks/entropy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
echo 0 >$tmperrorfile

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Collecting entropy data... (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion checks/iptables-22623-22624
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trap "rm ${errorfile}" EXIT
echo 0 >$tmperrorfile

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking if ports 22623/tcp and 22624/tcp are blocked (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
9 changes: 6 additions & 3 deletions checks/mellanox-firmware-version
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MIN_VERS=16.28

[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking Mellanox firmware version (${BLUE}using oc debug, it can take a while${NOCOLOR})"
output=1
fw_errors=0
# shellcheck disable=SC2016
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
Expand All @@ -30,20 +30,23 @@ if oc auth can-i debug node >/dev/null 2>&1; then
if [[ $(expr ${fw} \< ${MIN_VERS}) -eq 1 ]]; then
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}."
errors=$(("${errors}" + 1))
output=$(("${output}" + 1))
fw_errors=$(("${fw_errors}" + 1))
if [ ! -z "${ERRORFILE}" ]; then
echo $errors >${ERRORFILE}
fi
fi
done
else
msg "Couldn't find Mellanox firmware version in ${node}"
fi
fi
done
if [[ $fw_errors -gt 0 ]]; then
exit ${OCERROR}
fi
if [[ $output -gt 0 ]]; then
echo "No Mellanox cards found"
exit ${OCSKIP}
fi
exit ${OCINFO}
else
msg "Couldn't debug nodes, check permissions"
Expand Down
2 changes: 1 addition & 1 deletion checks/zombies
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trap "rm ${errorfile}" EXIT
echo 0 >$tmperrorfile

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Collecting zombie processes... (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion info/biosversion
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Check BIOS version to begin with
if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking bios versions (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion info/container-images-stored
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking container images stored in the cluster (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion info/ethtool-firmware-version
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")

if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking NIC firmware version using ethtool (${BLUE}using oc debug, it can take a while${NOCOLOR})"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down
2 changes: 1 addition & 1 deletion info/locks
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SCRIPT64=$(cat ./scripts/locks.sh | base64 -w 0)

[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")
if oc auth can-i debug node >/dev/null 2>&1; then
msg "Checking for locks by pod, per node (${BLUE}using oc debug, it can take a while${NOCOLOR})"

fw_errors=0
# shellcheck disable=SC2016
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
Expand Down
2 changes: 1 addition & 1 deletion info/mtu
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if oc auth can-i get network/cluster >/dev/null 2>&1; then
IFS=${OLDIFS}
else
if oc auth can-i debug node -A >/dev/null 2>&1 && oc auth can-i get nodes >/dev/null 2>&1; then
msg "Collecting MTUs... (${BLUE}using oc debug, it can take a while${NOCOLOR}))"

# shellcheck disable=SC2016
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
# See https://medium.com/@robert.i.sandor/getting-started-with-parallelization-in-bash-e114f4353691
Expand Down

0 comments on commit 612416c

Please sign in to comment.