All pastes #936497 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-03-10 13:58 UTC
rendered paste body
check_service()
{
        SERVICE=0
        nslookup www.somesite.com some.incorrect.ip.address >/dev/null 2>&1
        if [ $? -eq 1 ]; then SERVICE=1;fi

        if [ $SERVICE -eq 1 ]; then
                echo "SQUID NOK - One or more TCP/IP ports not listening."
                exitstatus=$STATE_CRITICAL
                exit $exitstatus
        fi
}

check_service

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