----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Jae Roh wrote:

> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> Chris and Duane.  What we do is have a simple Monitor.java class which
> simply returns the text "success".  Then we have a cron job run curl to
> check whether the whole apache-jserv shebang is responding.  If not, then we
> kick the individual JServ process.  (We run JServ in manual mode.)
>
> We're running a load balanced set of JServ processes, so we play some tricks
> with having dummy virtual hosts set up just for monitoring, so that we can
> tell which Jserv process among those in the pool are having problems.
>
> We never, ever, ever, need to restart the apache process.

Agreed. No need to ever restart Apache. We use simple checks for the basic case,
e.g.:
WARNING: ugly bash code, but it works

NUM_JSERVS=`ps awx | grep org\.apache\.jserv | grep -v grep | wc -l`
if [ ${NUM_JSERVS} -lt 1 ] ; then
    echo "[`date`] JServ is dead, restarting it..."
    /path/to/some/script/to/restart/jserv
fi

For the more complex cases, you can always create a simple servlet which reports
the overall status of the system through hard-coded strings, such as 'sucess' or
'failure', 'ok' or 'bad', or whatever you like. Then using wget you can check
the output of the servlet acessing your our webserver through the loopback
interface, for example.

( wget 'http://localhost/zone/someServlet?servletArg=value&servletArg2=value2'
-O - | grep ok ) ||
{
    echo "[`date`] Status servlet returned bad data, restarting JServ..."
    /path/to/some/script/to/restart/jserv
}

> I can tell you more about this in detail if you'd like.
>
> jae

Regards,
Ulisses Montenegro



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to