All pastes #936632 Raw Edit

Mine

public text v1 · immutable
·published 2008-03-10 15:19 UTC
rendered paste body
check_service()
{
SERVICE=1
nslookup www.somesite.com ip.of.bind.machine | grep "connection timed out" >/dev/null 2>&1
if [ $? -eq 0 ]; then SERVICE=0;fi

if [ $SERVICE -eq 0 ]; then
echo "NAMED NOT OK - Server appears to be down"
exitstatus=$STATE_CRITICAL
exit $exitstatus
fi
}


check_service

echo "NAMED OK - Everything running like it should"
exitstatus=$STATE_OK
exit $exitstatus