[Bio] / FigWebServices / server_check.cgi Repository:
ViewVC logotype

Annotation of /FigWebServices/server_check.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : olson 1.1 #
2 :     # Check to see if the SEED server is up and running.
3 :     #
4 :    
5 :     use FIG;
6 :     use CGI;
7 :     use strict;
8 :    
9 :     my $cgi = new CGI;
10 :    
11 :     my $fig;
12 :     eval {
13 :     $fig = new FIG;
14 :     };
15 :    
16 :     if ($@)
17 :     {
18 :     my $err = $@;
19 :     #
20 :     # Cannot create a FIG, often happens if the database is down.
21 :     #
22 :    
23 :     if ($err =~ /Could not connect to DBI:.*could not connect to server/)
24 :     {
25 :     print $cgi->header(-status => "501 Database not available $FIG_Config::dbms $FIG_Config::db $FIG_Config::dbport");
26 :     print $cgi->p("Could not connect to relational database of type $FIG_Config::dbms named $FIG_Config::db on port $FIG_Config::dbport.");
27 :     }
28 :     else
29 :     {
30 :     my $e = $err;
31 :     $e =~ s/\n.*$//;
32 :     print $cgi->header(-status => "502 Error constructing FIG: $e");
33 :     print $cgi->p("Could not construct fig object:");
34 :     print $cgi->pre($err);
35 :     }
36 :    
37 :     exit();
38 :     }
39 :    
40 :     print $cgi->header();
41 :     print $cgi->p("Server OK");
42 :     print "\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3