Operating System - Linux
1748181 Members
4007 Online
108759 Solutions
New Discussion

Shell script to monitor for a hung web page

 
Tom Wolf_3
Valued Contributor

Shell script to monitor for a hung web page

Hello all.

I'm trying to put together a shell script to check for a "hung" or unresponsive web page and generate an email if that occurs.

I've looked at some wget and curl examples on line but nothing really meets my needs.

In addition to checking for a hung web site, I was wondering how I would reproduce a hung web page to confirm the check actually works.

Any suggestions would be greatly appreciated.

Thanks in advance all.

1 REPLY 1
Steven Schweda
Honored Contributor

Re: Shell script to monitor for a hung web page

> [...] check for a "hung" or unresponsive web page [...]

   I'll interpret that as "check for an unresponsive Web server".

> [...] I've looked at some wget and curl examples on line but nothing
> really meets my needs.

   Here's some advice which is about as specific as your problem
description:  Wget works for me for this kind of task.  (I do it on VMS
with a batch-job DCL script, but I'd expect a shell script to be
similar, except for the way a time-out would be implemented.)

   Perhaps if you cite an actual example script and explain what makes
it deficient for your needs (or explain what your needs are), then you
might get more specific suggestions.

> [...] I was wondering how I would reproduce a hung web page to confirm
> the check actually works.

   A CGI script/program which includes a long sleep() ought to be easy
enough to implement.