check_vips.sh
#!/bin/sh
# quick n very dirty check
# wieviele IPs sollte ich haben?
SHOULD=10
VIPs=`/sbin/ip a | grep "inet " | wc -l | awk -F" " '{ print $1 }'`
if [ ! "$VIPs" -eq "$SHOULD" ]; then
echo "CRITICAL: owned IPs: $VIPs - should be: $SHOULD"
exit 2
else
echo "OK: owned IPs: $VIPs"
exit 0
fi
No Comments