Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce noise on output #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion checks/chronyc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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 @@ -8,7 +8,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 @@ -18,7 +18,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 @@ -15,7 +15,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=0
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 @@ -31,20 +31,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 -eq 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 @@ -8,7 +8,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 @@ -5,7 +5,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 @@ -4,7 +4,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 @@ -4,7 +4,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 @@ -8,7 +8,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 @@ -26,7 +26,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