forked from RHsyseng/openshift-checks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entropy
17 lines (16 loc) · 657 Bytes
/
entropy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash
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})"
for node in $(oc get nodes -o name); do
if ! ENTROPY=$(oc debug --image="${OCDEBUGIMAGE}" "${node}" -- chroot /host sh -c 'cat /proc/sys/kernel/random/entropy_avail' 2> /dev/null); then
msg "${ORANGE}Error running oc debug in ${node}${NOCOLOR}"
else
if [ -n "${ENTROPY}" ] && [ "${ENTROPY}" -lt 200 ];then
msg "${RED}Low entropy in ${node}${NOCOLOR}"
errors=$(("${errors}"+1))
fi
fi
done
else
msg "Couldn't debug nodes, check permissions"
fi