2025. 1. 15. 17:08 오라클
EM 13c 설치후 Cell Server down 으로 보일때
EM 13c showing Exadata Storage Server as Down While Cellci Is Showing MsStatus = Running (문서 ID 2900457.1 )
(에이전트 쪽 확인)
agent_13.4.0.0.0/plugins/oracle.sysman.xa.agent.plugin_13.4.1.0.0/scripts/exadata/oracle_exadata_response.pl
화일 내용 확인해 보면
cat /u01/app/agent/agent_13.5.0.0.0/plugins/oracle.sysman.xa.agent.plugin_13.5.1.0.0/scripts/exadata/oracle_exadata_response.pl
==============================
#!/usr/local/bin/perl
#
#
# oracle_exadata_response.pl
#
# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
#
# NAME
# oracle_exadata_response.pl - <one-line expansion of the name>
#
# DESCRIPTION
# <short description of component this file declares/defines>
#
# NOTES
# <other useful comments, qualifications, etc.>
# If "ping target" fails, report target is down (response metric returns em_result=0)
# else(if ping OK) run the current ssh routine to get target status.
# if ssh routine fails, "ping target" again.
# if this 2nd ping OK, report target metric collection error (em_error=...)
# else (this 2nd ping fails), report target is down (response metric returns em_result=0)
# else(if ssh OK) return Exadata status from ssh cellcli (em_result)
#
#
use strict;
require "emd_common.pl";
require "exadata/oracle_exadata_common.pl";
require "dbm/resp_util.pl";
my ($metricSource,$exaCLIUser, $exaCLIPwd,$trustSelfsigned, $httpsProtocol) = getInputInfo1();
my $ipaddress=$ARGV[0];
my $error_msg = "";
my $ipCheck = check_ipaddress_with_return($ipaddress,\$error_msg);
if ($ipCheck <= 0)
{
# Response status is 0
# MS Status is unknown
# ping status is failed
print "em_result=0|UNKNOWN|FAILED\n"; #not reachable
exit 0;
}
my $sshKeyFile;
if ($metricSource eq "cellcli" )
{
$sshKeyFile = check_sshKeyFile();
}
my $clicommand= ' list cell attributes msStatus ';
my $scriptName = 'oracle_exadata_response.pl';
my $command;
my $xmlout;
my $timeout = 120; # 2mins
my $status_ms;
my $test;
eval {
local $SIG{ALRM} = sub { die "alarm\n" }; # NB: \n required
alarm $timeout;
if ($metricSource eq 'cellcli')
{
$command = build_cellcli($sshKeyFile,$ipaddress, $clicommand,$timeout);
$xmlout = `$command`;
}
elsif ($metricSource eq 'exacli')
{
($command, $xmlout) = getExacliOutput($exaCLIUser,$exaCLIPwd, $ipaddress, $clicommand, $scriptName);
}
elsif ($metricSource eq 'restapi')
{
($command, $xmlout) = getRestAPIOutput2($exaCLIUser,$exaCLIPwd, $ipaddress, $clicommand, $scriptName,$trustSelfsigned, $httpsProtocol);
}
if ($? != 0 )
{
#ping ipaddress again
my $result = check_status($ipaddress);
$test = $result; # save it
EMD_PERL_DEBUG("check_status on cell host $ipaddress returned $result");
if ($result <= 0) {
EMD_PERL_DEBUG("exadata_response cellcli failed and the 2nd ping failed too.\n");
# Response status is 0
# MS Status is unknown
# ping status is failed
print "em_result=0|UNKNOWN|FAILED\n"; #not reachable
alarm 0;
exit 0;
} else {
alarm 0;
#if CELL-01529 duplicated command is returned, treat MS as running;
#for other errors, report em_error
if ( index($xmlout, "CELL-01529") >= 0 )
{
EMD_PERL_DEBUG("Hit CELL-01529: Duplicate command execution.\n");
# Response status is 1
# MS Status is running
# ping status is SUCCESS
print "em_result=1|RUNNING|SUCCESS\n";
exit 0;
} else {
print "em_error=Failed to execute_exadata_response.pl $command: $xmlout\n";
exit -1;
}
}
}
alarm 0;
};
if ($@) {
die unless $@ eq "alarm\n"; # propagate unexpected errors
if ($test != 1) {
# Response status is 0
# MS Status is unknown
# ping status is failed
print "em_result=0|UNKNOWN|FAILED\n"; #not reachable
exit 0;
} else {
print "please check on the agent host,if ssh access is setup according to the installation guide and is working as expected";
exit -1; # Indicate timeout and unavailabilty.
}
# timed out
}
#my $xmlout = `$command`;
my $parser = XML::Parser->new( Handlers => {
Start=>\&handle_start,
End=>\&handle_end,
Char=> \&characterData,
});
my $result;
my $myinf;
$parser->parse( $xmlout);
#print "em_result=$result\n";
#-----------------------------------------------------------------
# FUNCTIONS : handle_start
#
#
# DESC : Does node based parsing of the XML output.
#
# ARGUMENTS :
# elements : Node elements in the XML
# attrs : Attributes of the elements.
#
#
#-----------------------------------------------------------------
sub handle_start {
my( $expat, $element, %attrs ) = @_;
$myinf="";
if ($element eq "msStatus")
{
$myinf="status_ms";
}
}
sub handle_end {
my( $expat, $element, %attrs ) = @_;
my $status = "";
if ($element eq "msStatus")
{
if ($status_ms eq "running") {
$status_ms="1";
$status = "RUNNING";
} else {
$status_ms="0";
$status = "DOWN";
}
print "em_result=$status_ms|$status|SUCCESS\n";
exit 0;
}
elsif ($metricSource eq "exacli" || $metricSource eq "restapi")
{
if ($element eq "cell")
{
$status_ms="1";
$status = "RUNNING ";
print "em_result=$status_ms|$status|SUCCESS\n";
exit 0;
}
elsif ($element eq "fault")
{
$status_ms="0";
$status = "DOWN";
print "em_result=$status_ms|$status|SUCCESS\n";
exit 0;
}
}
}
sub characterData {
my( $parseinst, $data ) = @_;
my $space=" ";
$data =~ s/\n//g;
if (($data !~ m/^\s/) and ($data ne "\""))
{
if ($myinf eq "status_ms" )
{
$status_ms=$status_ms.$data;
}
}
}
==============================
이중 "running " 부분 찾아서 뒤에 공백 확인 후 삭제 후 저장
cd <agent_inst>/bin
./emctl reload agent
./emctl control agent runCollection <name of Exadata Storage Cell target>:oracle_exadata Response