[ic] interchange server not running

Marty interchange-users@icdevgroup.org
Fri Sep 20 18:12:00 2002


On Fri, 2002-09-20 at 14:32, New Revelation Ministries, Inc. wrote:
> Apparently, my host had to reboot the system for some upgrades they made and
> this caused my Interchange to go offline or something like that. It gave the
> error 404: Page Cannot Be Found. Is there any way that Interchange can
> remain enabled even through system reboots or will I have to test my cart
> EVERY day to make sure it's still up and running?
> 

You can design a simple little test that will determine if you site is
on-line or off-line.  Here is what I do.  You can install something
similar to this or have one of the admins who monitor your machine
install it. 

1) Add a new variable to variable.txt like this, and "apply changes"

IS_IC_UP	YES_IC_IS_UP	General

2) Create a page called is_ic_up.html and put this code in it.  

[either]__IS_IC_UP__[or]NO[/either]

3) Create a script to query that page.

# Note: Remember to set $homedir and $geturl or 
# hard code them in the script.
$result = `GET http://$geturl/query/is_ic_up.html`; 
chomp($result);
  if ( $result !~ /YES_IC_IS_UP/) {
    system("$homedir/interchange/bin/interchange -r -u");
  }else{
    print "Successfully retrieved is_sediva_up.html via http\n";
  }

4) Add a cron entry that calls the script every 15 minutes.
0,15,30,45 * * * * /somepath/is_ic_up.pl > /somepath/is_ic_up.log 2>&1 &

5) Sleep at night.   :)

You can periodically monitor the is_ic_up.log to check on things.  I've
been running a script similar to this (I also check the connection
between Mysql and interchange) and it seems to do the trick.  If the
server ever has to be rebooted in the middle of the night, I only suffer
a few minutes of downtime. 

You can add an email or pager routine to email and/or page you pretty
easily. 
-- 
-  - -- ----  ----------------------------------------- --- -- -   -
Marty Tennison
-  - -- ---- 
-------------------------------------------------------------- --- -- - 
-