<div dir="ltr">It seems like you'd want something that checked the page from outside. If you scripted something and set it up as a cron, you'd only find out about it if the server was otherwise functional. I can set up a check on my Nagios server, though there might be gratis services on the Internet that do that. If so, I haven't found any.<div>
<br></div><div>If you're interested, the simple check that I usually use to check sites looks like this (Nagios is CRITICAL on exit 2, OK on exit 0):</div><div><br><div>#!/bin/bash</div><div><br></div><div>Catch() {</div>
<div> code=$1</div><div> message=$2</div><div><br></div><div> if [[ $code -ne 0 ]]</div><div> then</div><div> echo "ERROR: $message. Returned $code"</div><div> exit 2</div><div> fi</div><div>}</div>
<div>
<br></div><div>url='http://<some page on my site>'<br></div><div>string='<some string that's on my page when it's working>'</div><div>contents=$(curl -s $url)<br></div><div>Catch $? "Could not connect to $url"</div>
<div>echo "$contents" | grep "$string" > /dev/null</div><div>Catch $? "Couldn't find $string in $url"</div><div>echo "OK: Found $string in $url"</div><div>exit 0</div><br></div>
</div>