On Fri, 2003-08-08 at 10:02, Chris wrote:
> I have an intermitent problem on one of my servers with the Apache service
> failing at random intervals.  How would I go about checking, in a shell
> script (run every few minutes with cron), whether httpd service is "running"
> or "stopped", and if "stopped" run a command or another shell script that
> would page me immediately or execute some code of my choice?  I hope this
> would help me instantly see when the problem occurs, see what's happening on
> the server at the time, etc, and hopefully resolve whatever may be causing
> Apache to stop for "no reason."
> 
> Thank you,
> 

Chris 

you would have better luck starting a new thread rather than replying to
and existing one and changing the subject.  SOme folks may not even see
your post if they have decided to not follow this thread.

several ways to do this but the first thing that comes to mind is to
check if the pid file is in /var/run/

of course you could do something like:

ps xa |grep [h]ttpd >/dev/null;
if [ ${?} -eq 0 ];then 
    echo running;
    else 
    echo not running;
    do something

fi

HTH

Bret


-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list

Reply via email to