Index: openacs-4/www/SYSTEM/dbtest.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/www/SYSTEM/dbtest.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/www/SYSTEM/dbtest.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/www/SYSTEM/dbtest.tcl 17 Nov 2009 22:26:13 -0000 1.2 @@ -1,24 +1,26 @@ ad_page_contract { - - This is called by server monitoring scripts, such as + + This is called by server monitoring scripts, such as keepalive (see http://arsdigita.com/free-tools/keepalive.html) if it doesn't return "success" then they are supposed to kill the AOLserver. You can also use this with our Uptime monitoring system, described in Chapter 15 of http://photo.net/wtr/thebook/ - This tests total db connectivity. + This tests total db connectivity of all 3 database pools. @cvs-id $Id$ } { } -if { ![db_0or1row date_check { - select sysdate from dual -}] } { - doc_return 500 text/plain "failed" +if { [catch { + db_foreach check_pool1 "select sysdate from dual" { + db_foreach check_pool2 "select sysdate from dual" { + db_1row check_pool3 "select sysdate from dual" + } + } +} errmsg] } { + doc_return 500 text/plain "failed" } else { ns_return 200 text/plain "success" } - -