[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Checkstat.sh replacement
****** message to minivend-users from "Thompson-Jordan" <Thompson-Jordan@mindspring.com> ******
A while back Ryan Hertz wrote a script for crontab to check if Minivend is
running and restart it if it is not. I have modified it a little and
thought I would post it. I didn't need the chmod stuff so I removed it.
Also, because my store is hosted, putting "mail orders" in crontab sends
mail to my hosting company, not me. Crontab mails all output to me anyway.
Here is the script. I call it "mvcheck"
Christopher Thompson
#/bin/sh
#
# mvcheck
#
MVURL='www.mysite.com/cgi-bin/simple'
MVDIR='/home/mysite/minivend'
lynx -source $MVURL > mvcheck.out
if cat mvcheck.out | grep "Internal Server Error" > /dev/null
then
echo "Minivend Server Down: Internal Server Error"
$MVDIR/bin/restart
cat mvcheck.out
elif cat mvcheck.out | grep "server not running" > /dev/null
then
echo "Minivend Server Down: server not running"
$MVDIR/bin/restart
cat mvcheck.out
elif cat mvcheck.out | grep "We're sorry, the Minivend server is
unavailable" > /dev/null
then
echo "Minivend Server Down: We're sorry, the Minivend server is
unavailable"
$MVDIR/bin/restart
cat mvcheck.out
fi
> ****** message to minivend-users from Ryan Hertz
> <rhertz@gyb.baits.com> ******
>
> This is what I use -- called from my crontab:
>
> lynx -source 10.10.30.76/cgi-bin/order > teststore.out
> if cat teststore.out | grep "Internal Server Error" > /dev/null
> then
> cat teststore.out | mail orders
> chmod -R 0755 /var/lib/httpd/mvend
> /var/lib/httpd/mvend/bin/restart
> elif cat teststore.out | grep "MiniVend server not running" > /dev/null
> then
> cat teststore.out | mail orders
> chmod 775 /var/lib/httpd/cgi-bin/order
> chmod s+u /var/lib/httpd/cgi-bin/order
> /var/lib/httpd/mvend/bin/restart
> elif cat teststore.out | grep "We are sorry, but the cgi-bin server is
> unavailable" > /dev/null
> then
> cat teststore.out | mail orders
> fi
>
> Some warnings: if the cron fails (i.e. lynx cannot connect because your
> webserver has gone down), the output gets mailed to the user running the
> crontab - I would recommend that the 'orders_to' account run
> the crontab.
>
> Also, the chmods are incase I goof up permissions - it tries to fix
> itself... however, if the 'orders_to' is running the crontab, then you
> won't have permissions to change the permissions -- without
> security holes.
>
> If this back-woods town ever gets digital cellphone service I'd have the
> script mail a email front to the pager on the phone...
> chances are if the
> store is failing and I'm able to read my email - I already know.
>
> Caveat emptor and your mileage may vary.
>
> Ryan Hertz tel
> 520-645-3812
> Webmaster tel
> 800-645-BAIT
> Advertising Director fax
> 520-645-2588
> Gary Yamamoto Custom Baits, Inc.
http://www.yamamoto.baits.com
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list