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 10, 2022
1 parent 195cc0d commit df66d55
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 16 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} 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
10 changes: 7 additions & 3 deletions info/intel-firmware-version
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ INTEL_IDS="${INTEL_IDS:=8086:158b}"
[ -z ${UTILSFILE} ] && source $(echo "$(dirname ${0})/../utils")

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

# shellcheck disable=SC2016
output=0
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
((i = i % PARALLELJOBS))
Expand All @@ -20,13 +21,16 @@ if oc auth can-i debug node >/dev/null 2>&1; then
else
if [ -n "${FIRMWAREVERS}" ]; then
msg "${node}:\n${FIRMWAREVERS}"
else
msg "Couldn't find Intel firmware version in ${node}"
output=$(("${output}" + 1))
fi
fi
) &
done
wait
if [[ $output -gt 0 ]]; then
echo "No intel cards found"
exit ${OCSKIP}
fi
exit ${OCINFO}
else
msg "Couldn't debug nodes, check permissions"
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/mellanox-firmware-version
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IDS="15b3:1015 15b3:1017 15b3:1013 15b3:101b"
[ -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})"

# 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/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 df66d55

Please sign in to comment.