> Is there a simple perl sript that can monitor squid process, I can't find
> one on google pls help....Im not too familiar with perl scripting....by
the
> way here's the condition.
>
> 1.) looking for the squid process (like "ps aux | grep squid" commnand in
> unix)
> 2.) If there is squid process, nothing to be done then exit.
> 3.) If there's no squid process, simply start squid service and exit.
>
hello ed. i just made a simple bash script, you can put it with your cronjob
every X interval.
haven't tested it, it should work on RH 7x, RH8X RH9X and FC1/FC2 ...hope
it works for you.
#! /bin/bash
PATH=/usr/bin:/bin
export PATH
date=`date "+%A %m-%d-%Y %r"`
num=0
ayos=`/sbin/pidof squid | awk '{ print $1}'`
if [ $ayos > 0 ] ; then
num=1
fi
if [ $num = 0 ]; then
echo Starting SQUID...
#restart squid service
/sbin/service squid restart
#inform you
echo "Restarted at $date" | mail -s "Squid Script Restart "
[EMAIL PROTECTED]
else
#go and sleep
echo Gising ang Squid!
fi
#echo "Resulta : " $num $ayos
goodluck
//milver
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie