PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Fuan, Ah kau (London)" <fuanahk at MLE dot CO dot UK>
Subject: Sybperl etc
Date: Feb 4 1999 2:05PM

Can anyone experienced in Sybperl please help.  I have written a  perl
script to monitor  replication server by  connecting via isql and issuing
the  sql command via  dbcmd and dbsqlexe as follows:
....
(  establish connection, once in , do a while loop sleeping for 5 mins each
time)
....
...
$sqltext = "admin who";
$dbproc -> dbcmd($sqltext); 
if (($dbproc -> dbsqlexec) == 0)  {  
$Msg = "Connection to Repserver broken. Suspect repserver down. Please
action"; 
 print SCRIPT "\n$Msg";
&sendMsg($GetsAllMsgs,$Msg,$GetPages,3); 
  exit 23;
}


The &sendMsg  is just a  subroutine to beep the error msg through a pager.

The way it is intended to work is that once every 5 mins, the script would
loop round, send off  the sql command  "admin who"  to the repserver and
grep for msg like suspended.  If the repserver is down when it comes round
to fire off the sql command, then it will send off the msg "Connection to
Repserver broken.....".  

It worked in my test server. But not in the production server. 

On the test server, I got :
 
DB-Library error:
		Unexpected EOF from SQL Server.
Connection to Repserver broken............       and the pager beep,  which
is what I expected.


On production server, I got:

DB-Library error:
		Unexpected EOF from SQL Server.

  . and nothing else.  No pager beep, no message.


The rest of the script works fine.

Any idea ?

AK Fuan
Merrill Lynch Europe