merlin_ping.pl
{
/* __________________________________________________________________________
Copyright (C) DataAspects, Inc. 1998
merlin_ping.pl
Objective: Determine if a particular Merlin pool is loaded and available
for searching.
Actions:
1. CLIENT merlin_ping.pl connects to TRIMrpc chemcop.pl
running on ChemServer & passes it three parameters:
parm.0 db_exec - issue a command to chemcop
parm.1 'merlin_ping' - name of command to execute
parm.2 list_name - name of list w/ 1 row, name of Merlin pool
2. SERVER
3. Chemcop.pl executes pingmerlin, a UNIX script.
pingmerlin takes two parameters as input,
parm.1 name of the database
parm.2 name of the output ASCII file
4. pingmerlin generates a list of all databases currently open
by Merlin and available for searching and writes them to
the ascii file.
5. Chemcop opens the ascii file into a list and returns it to the client.
6. pingmerlin can be run from the command line:
An example of a database currently loaded:
input: pingmerlin cis outlist.txt
output: Opened "/usr1/daylight/thordb/cis.THOR@etchem:merlin"
with permission "r".
An example of a database not loaded:
input: pingmerlin aquire94 outlist.txt
output: merlindbping: Database isn't loaded, and may not exist
...Pat McGreevy, 18 Feb 99
________________________________________________________________________________ */
char db[20];
char merlinserver[20];
int rc;
list db_list;
list temp_list;
db= prompt("Merlin pool to ping: ");
if (db){
db= lower(db);
db_list= list_open("20",1,"Merlin Pool List");
list_mod(db_list,1,db);
merlinserver= "xxx.xxx.xx.xx";
printf("Wait...Connecting to Chemcop on MerlinServer");
if (trap({
connect(0,"net:chemcop@"^^G.merlinserver^^"!vtxhost.trm");
printf(" Connected to Chemcop");
})){
bell();
printf(" Failed to connect to Chemcop on MerlinServer");
break;
}
rc= (exec_sql("merlin_ping",db_list)); /* RPC Call */
temp_list= list_open("select results",1000);
if (list_rows(temp_list)) /* display error message */
list_view3(temp_list,-2,-2,-1,key_f3,opt_highlight,0);
} /* end if(db){... */
}