- 论坛徽章:
- 0
|
################################################################################
# Reponse test for Oracle Listener
#
# Description: Response test for Oracle Listener
#
# Dependendcies:
# ORACLE_SID env var
# ORACLE_HOME env var
################################################################################
$ORACLE_HOME = $ENV{ORACLE_HOME};
$ORACLE_SID = $ENV{ORACLE_SID};
$tnsping = "$ORACLE_HOME/bin/tnsping";
# ensure that the Oracle Env vars are set. If not, post an event message
# but pass the test.
if (! $ORACLE_HOME)
{
$mesg = "Env var ORACLE_HOME not set. Check the listener's process config.";
&PostError($mesg);
exit 0;
}
if (! $ORACLE_SID)
{
$mesg = "Env var ORACLE_SID not set. Check the listener's process config.";
&PostError($mesg);
exit 0;
}
# check to see that tnsping exists. If not, go NO RESPONSE.
if (! (-e $tnsping))
{
$mesg = "$tnsping not found.";
&PostError($mesg);
exit 1;
}
# Run the tnsping test. If the listener isn't running the test will cause the
# LCE listener process to transition to the NO RESPONSE state.
$command = "$tnsping $ORACLE_SID";
system($command);
$ret = $? / 256;
if ($ret != 0)
{
$mesg = "$tnsping returned an error: $ret";
&PostError($mesg);
exit($ret);
}
exit(0);
################################################################################
#
# SUBROUTINE: PostError()
#
################################################################################
sub PostError
{
local($errMesg) = @_;
push(@INC, "$ENV{FT_DIR}/bin");
require "ft.pl";
&ft'PostEvent($FT'SEV_ERROR,"Listener Response Test Error: $errMesg");
return;
}
################################################################################
# Reponse test for Oracle Listener
#
# Description: Response test for Oracle Listener
#
# Dependendcies:
# ORACLE_SID env var
# ORACLE_HOME env var
################################################################################
$ORACLE_HOME = $ENV{ORACLE_HOME};
$ORACLE_SID = $ENV{ORACLE_SID};
$tnsping = "$ORACLE_HOME/bin/tnsping";
# ensure that the Oracle Env vars are set. If not, post an event message
# but pass the test.
if (! $ORACLE_HOME)
{
$mesg = "Env var ORACLE_HOME not set. Check the listener's process config.";
&PostError($mesg);
exit 0;
}
if (! $ORACLE_SID)
{
$mesg = "Env var ORACLE_SID not set. Check the listener's process config.";
&PostError($mesg);
exit 0;
}
# check to see that tnsping exists. If not, go NO RESPONSE.
if (! (-e $tnsping))
{
$mesg = "$tnsping not found.";
&PostError($mesg);
exit 1;
}
# Run the tnsping test. If the listener isn't running the test will cause the
# LCE listener process to transition to the NO RESPONSE state.
$command = "$tnsping $ORACLE_SID";
system($command);
$ret = $? / 256;
if ($ret != 0)
{
$mesg = "$tnsping returned an error: $ret";
&PostError($mesg);
exit($ret);
}
exit(0);
###################################################
标准的 |
|