"I do not want to recieve 4000 emails that the server is down. I just want one email."
Then why do you check it 4000 times?
Why don't you just create one small script that runs from the crontab once every five minutes, and sends you an email if it can't connect?
A forum, a FAQ, what else do you need?