[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: www site monitor



On 11/02/12 04:29, pch0317 wrote:
> Hi list,
> 
> I must monitor remote site to check that it works. I refresh this site
> from time to time in web browser. Can I automate this process?
> I search for service which:
> - monitors *remote* WWW site (via http request)
> - when remote site doesn't respond for example 5 minutes it notify some
> person (via e-mail or SMS).
> 
> Is that service available in Debian repository? Or is there any
> commercial product which do that?
> 
> 
> Best regards
> 
> 
As has already been suggested - mon will do the job *if* all you want to
do is check to see the server is up.... Nagios will do more, though it's
probably overkill.

It's possible that just knowing the server is serving "something* may
not be what you're after...

If you want to check that the site is functioning[*1] as expected then
you have several, scripted, options depending on how deep you want to
test (any modifications, file size, site wide tests).


Use wget[*2]

Use curl and just compare filesize against an expected value - or use
pgp to check for any changes.

There's a number of gratis webservices like pingdom which will confirm
the site is up (and maybe serving fake antivirus or 503s).



[*1] you may wish to test ports 25, 53, 80 and 443 (and others).
My personal preference is to run check on the server, then send (tiny)
email status reports to a remote client. The absence of a regular report
indicates a serious problem. Changes to the subject line indicate
various errors. The remote client box can then alert your mobile with an
email if needed.

[*2] eg.:-
#!/bin/bash
WGET="/usr/bin/wget"
$WGET -q --tries=20 --timeout=5 $site2test -O /tmp/site.test &> /dev/null
if [ ! -s /tmp/site.test ];then
	echo "crapulence"
else
	echo "go back to sleep"
fi
=======4cron==================
* * * * * /usr/bin/wget "$site2test " --timeout 20 -O - 2>/dev/null  |
grep "go back to sleep" || echo "crapulence" | /usr/bin/mail -v -s
"crapulence" d.duck@wonderland.mil
==============================


Kind regards

-- 
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


Reply to: