mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-03-01 09:10:22 +00:00
My comment was eaten by github in !152 and wanted to raise attention incase this was meant to be an exit instead of an echo, otherwise feel free to close!
24 lines
568 B
Bash
Executable File
24 lines
568 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# This plugin checks for common network issues. Currently, it only checks
|
|
# if the conntrack table is full.
|
|
|
|
OK=0
|
|
NONOK=1
|
|
UNKNOWN=2
|
|
|
|
[ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_max ] || exit $UNKNOWN
|
|
[ -f /proc/sys/net/ipv4/netfilter/ip_conntrack_count ] || exit $UNKNOWN
|
|
|
|
conntrack_max=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_max)
|
|
conntrack_count=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_count)
|
|
|
|
if (( conntrack_count >= conntrack_max )); then
|
|
echo "Conntrack table full"
|
|
exit $NONOK
|
|
fi
|
|
|
|
echo "Conntrack table available"
|
|
exit $OK
|
|
|