Installing Oracle Management Agent in Silent Mode by Using the AgentPull Script

This is to demonstrate how to install 13.5 Oracle Management Agent in Silent Mode by Using the AgentPull Script .

Note: To install a Management Agent using the AgentPull script, you DO NOT need to download the Management Agent software onto the destination host. The AgentPull script performs this action automatically.

Get AgentPull script from OMS by running the following command, here we are going to install 13.5 agent on Linux platform.

On web to download AgentPull.sh script bu the following URL:
https:/OMS_HOST:OMS_PORT/em/install/getAgentImage

OR

$ cd /tmp
$ curl "https://OMS_HOST:OMS_PORT/em/install/getAgentImage" --insecure -o AgentPull.sh
$ chmod +x /tmp/AgentPull.sh

Identify the Platform by :

$ ./AgentPull.sh  -showPlatforms

Platforms Version
Linux x86-64 13.5.0.0.0

Create a response file for installing the new agent:

$ cat /tmp/agent.properties
LOGIN_USER=sysman
LOGIN_PASSWORD=sysmanpasswd
PLATFORM="Linux x86-64"
AGENT_REGISTRATION_PASSWORD=abcd1234
AGENT_BASE_DIR=/u01/app/oracle/product/13.5.0/agent_1

Install OEM agent by running the following command now:

$ /tmp/AgentPull.sh RSPFILE_LOC=/tmp/agent.properties 

The new agent should be installed and registered on OMS successfully.

But I got agent evaluation errors on OMS for newly installed agent. it is resolved through:

  • Disabled firewalld
  • EM 13c: Agent Shows Availability Evaluation Error with Message: Target data is currently being uploaded to the repository (Doc ID 2379296.1)

M 13c: Enterprise Manager 13c Cloud Control Agent Control Commands Respond with Message: Invalid EMSTATE valueEMD

The “Invalid EMSTATE valueEMD” error occurs when reload/upload/pingOMS agent:

oracle:/u01/app/oracle/product/13.5.0/agent_1/agent_inst/bin$ ./emctl reload  agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Invalid EMSTATE valueEMD reload completed successfully

Check what value is for EMSTATE :

$ cat emctl
#!/bin/sh -f
#++
#
#  16-dec-02.15:38:56 vnukal
#
# Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
#
#  emctl - control script for state-only agent installs.
#
#    MODIFIED   (MM/DD/YY)
#    mkiran       11/27/11 - 13417393: Pass args via "$@" instead of $*
#    vnukal       12/16/02 - Creation
#--
REMOTE_EMDROOT=/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0
export REMOTE_EMDROOT
REMOTE_EMDROOT_AGHOME=/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0
export REMOTE_EMDROOT_AGHOME
EMSTATE=/u01/app/oracle/product/13.5.0/agent_1/agent_inst
export EMSTATE
/u01/app/oracle/product/13.5.0/agent_1/agent_13.5.0.0.0/bin/emctl "$@"

SOLUTION

The issue is that the group has write privilege for the directory agent_inst. This is not allowed, group should only have read and execute privilege .

Run the chmod utility to change the the access permissions as follows:

chmod g-w agent_inst

$ ./emctl upload  agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully
$ ./emctl pingOMS
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD pingOMS completed successfully
$ ./emctl reload  agent
Oracle Enterprise Manager Cloud Control 13c Release 5
Copyright (c) 1996, 2021 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD reload completed successfully

EM GC_Domain OHS Target Alerts with Error: “The Percentage Of Requests That Resulted In Errors Is X%”

The OHS log at <GC_INST>/user_projects/domains/GCDomain/servers/ohs1/logs/ohs1.log shows messages like the following:

[2018-08-07T10:37:08.5618-05:00] [OHS] [ERROR:32] [] [core.c] [client_id: <client ip address>] [host_id: <OMS hostname>] [host_addr: <OMS IP address>] [tid: 140073893857024] [user: oracle] [ecid: 0000MIjGpMU3b6M5mNT4iZ1RHes^00000F] [rid: 0:5701] [VirtualHost: <OMS hostname>:0] client denied by server configuration: <PATH TO $GC_INST>/WebTierIH1/config/OHS/ohs1/htdocs/empbs

Cause

One of the agents was trying to upload data to the EM repository using the  unlocked http url, and the EM OMS upload repository is locked.

The agent can be found by using the client IP address in the ohs1.log file, as indicated here: [client_id: <client ip address>]

Solution

Secure that agent on the machine identified by that IP address by running:

emctl secure agent

This will prompt for the registration password. If you or your administrators do not have this password one can be set following this note: Note 1367946.1 – Enterprise Manager Cloud Control Security: How to Create or Edit the Agent Registration Password for Agent to OMS Secure Communication

emctl status agent : Status agent Failure:unable to connect to http server at [handshake has no peer]

OEM agent is unhealthy with the following errors:

$ emctl status agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
Status agent Failure:unable to connect to http server at https://racnode1:3872/emd/lifecycle/main/. [handshake has no peer]

$ emctl stop agent
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation. All rights reserved.

$ emctl pingOMS
Oracle Enterprise Manager Cloud Control 13c Release 4
Copyright (c) 1996, 2020 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD pingOMS error: unable to connect to http server at https://racnode1:3872/emd/main/. [handshake has no peer]

Error stack observed from <Agent_Inst>/sysman/log/emagent.nohup file:

—– 2024-04-13 10:03:14,913::8313::Checking status of EMAgent : 10965 —–
—– 2024-04-13 10:03:14,913::8313::Hang detected for EMAgent : 10965 —–
—– 2024-04-13 10:03:14,913::8313::Debugging component EMAgent —–
—– 2024-04-13 10:03:14,913::generate first thread dump file for diagnosis —–
—– 2024-04-13 10:03:27,394::generate second thread dump file for diagnosis —–
—– 2024-04-13 10:03:27,592::generate Threads.10965lsof.1 for diagnosis —–
—– Attempting to kill EMAgent : 10965 —–
—– 2024-04-13 10:03:32,660::8313::EMAgent exited at 2024-04-13 10:03:32,660 with signal 9 —–
—– 2024-04-13 10:03:32,660::8313::EMAgent either hung or in abnormal state. —–
—– 2024-04-13 10:03:32,660::8313::EMAgent will be restarted/thrashed. —–
—– 2024-04-13 10:03:32,660::8313::writeAbnormalExitTimestampToAgntStmp: exitCause=ABNORMAL : restartRequired=1 —–
—– 2024-04-13 10:03:32,660::8313::Restarting EMAgent. —–
—– 2024-04-13 10:03:32,875::8313::Auto tuning the agent at time 2024-04-13 10:03:32,875 —–
—– 2024-04-13 10:03:40,237::8313::Finished auto tuning the agent at time 2024-04-13 10:03:40,237 —–
—– 2024-04-13 10:03:40,238::8313::Launching the JVM with following options: -Xmx128M -XX:MaxMetaspaceSize=224M -server -Djava.security.egd=file:///dev/./urandom -Dsun.lang.ClassLoader.allowArraySyntax=true -XX:-UseLargePages -XX:+UseLinuxPosixThreadCPUClocks -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -DHTTPClient.dontSeekTerminatingChunk=true —–
—– 2024-04-13 10:03:40,239::8313::Agent Launched with PID 81582 at time 2024-04-13 10:03:40,239 —–
—– 2024-04-13 10:03:40,239::81582::Execing EMAgent process is taking longer than expected 120 secs —–
—– 2024-04-13 10:03:40,239::81582::Time elapsed between Launch of Watchdog process and execing EMAgent is 727958 secs —–

SOLUTION

1. Take the backup of the <Agent_Inst>/sysman/config/emd.properties file.

2. Update the following property as below:

agentJavaDefines=-Xmx128M -XX:MaxMetaspaceSize=224M

TO

agentJavaDefines=-Xmx512M -XX:MaxMetaspaceSize=224M

3. Save the file.

4. Try restarting the agent.
$ emctl stop agent
$ emctl start agent

EM 13c: The agent has been blocked by the OMS

OEM agent was blocked with the following messages in agent log:

...
..
.
2023-12-05 20:16:59,448 [158:905DEBE9] INFO - The agent has been blocked by the OMS.
2023-12-05 20:16:59,448 [158:905DEBE9] INFO - Reason the OMS blocked the agent: Resync
...
..
.

SOLUTION

  1. Perform agent resynchronization from OEM console.

    AND / OR
  2. Modify bounceCtr value in agntstmp.txt file to one less than repository value and save it.
Get Bounce_CTR value from repository database as SYSMAN:


SQL>select BOUNCE_CTR from MGMT_EMD_PING where TARGET_GUID=(select target_guid from mgmt_targets where target_name ='<agent_home>:<port>');
BOUNCE_CTR
29

For a health agent, bounceCtr value in agntstmp.txt file must be at 119.

$emctl stop agent

2. Take backup of file and edit agntstmp.txt from <AGENT_HOME>/agent_inst/sysman/emd/


From
bounceCtr=88
To
bounceCtr=28

3. Save file and start agent

$emctl start agent