EM12c agent installation for Windows hosts…without Cygwin!

The majority of Enterprise Manager 12c Cloud Control agent installations are pretty straight forward, just do the usual checks, ensuring firewalls are open etc. and then deploy from the EM console.  The Windows installations are not as straight forward these days, as the deployment method uses SSH connectivity which requires the installation and configuration of Cygwin as a pre-requisite 🙁 …this is time consuming, confusing at times (if you’ve not done it before), and isn’t needed thereafter, so this post outlines an alternative and quicker way of rolling out the agent to Windows machines, using the silent install method…

The example below is based around my EM12c OMS running from an Oracle Linux 6.4 machine (VM0112), with the agent being deployed to a Windows Server 2003 x64 (64-bit) machine (VM0201).

First of all, you need to make sure  the software library has already been configured in EM12c.  I’d imagine most people at this stage have this setup already, but if not take a look here.

Check software availability using EMCLI from OMS

We need to connect to the EM repository using EMCLI and check which agents are available i.e. images that have been downloaded and applied:

export OMS_HOME=/u01/app/oracle/product/middleware/em12cr3/oms
export AGENT_HOME=/u01/app/oracle/product/agent12c/core/12.1.0.3.0
export JAVA_HOME=$AGENT_HOME/jdk

Login as the SYSMAN user:

$OMS_HOME/bin/emcli login -username=sysman -password=******
Login successful

Fetch a list of agent software available from the the repository:

$OMS_HOME/bin/emcli get_supported_platforms
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Linux x86-64
-----------------------------------------------
Platforms list displayed successfully.

In this example, you can see I only have the agent software available for Linux.  If you already have the software, ignore the next section and move onto building the image.

Download the Microsoft agent software

I won’t go into too much detail about how to do this, but you need to ensure you’re My Oracle Support connection has been configured in EM12c, then navigate to:

Setup > Extensibility > Self Update > Agent Software

From here you can check for the latest updates and download the required software.  In this case, I’m after the latest ‘Microsoft Windows x64 (64-bit)’, which at the time of writing is version 12.1.0.3.0.  Screenshots as below…

 

 

 

 

 

 

 

Once the download has completed and been applied to the software library, go back to your EMCLI session, run a synchronize command and check again:

$OMS_HOME/bin/emcli sync
Synchronized successfully

$OMS_HOME/bin/emcli get_supported_platforms
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

Build an image for the agent

My software library simply sits under /swlib on my OMS machine.  I’m going to create a sub-directory here for this particular agent, then generate a zip file that can be used to deploy the agent locally from my Windows x64 server.

mkdir /swlib/win_x64_agent
export ZIP_LOC=/usr/bin/zip

NOTE: It’s important to set ZIP_LOC here, otherwise you’re likely to get an ‘execution failed’ message during the build (MOS 1590393.1).

Again using EMCLI, run the following command to generate a zip file (checking the platform and version):

$OMS_HOME/bin/emcli get_agentimage -destination="/swlib/win_x64_agent" -platform="Microsoft Windows x64 (64-bit)" -version=12.1.0.3.0

=== Partition Detail ===
Space free : 18 GB
Space required : 1 GB
Check the logs at /u01/app/oracle/product/middleware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2014-02-06_10-21-17-AM.log
Downloading /swlib/win_x64_agent/12.1.0.3.0_AgentCore_233.zip
File saved as /swlib/win_x64_agent/12.1.0.3.0_AgentCore_233.zip
Downloading /swlib/win_x64_agent/12.1.0.3.0_PluginsOneoffs_233.zip
File saved as /swlib/win_x64_agent/12.1.0.3.0_PluginsOneoffs_233.zip
Downloading /swlib/win_x64_agent/unzip
File saved as /swlib/win_x64_agent/unzip
Agent Image Download completed successfully.

Now you can copy the ‘12.1.0.3.0_AgentCore_233.zip’ file across to your Windows server where you want to install the agent (using something like FileZilla or WinSCP):

Unzip the contents to a temporary directory like: D:\temp\12.1.0.3.0_AgentCore_233

Update installation files

Edit the agent response file (agent.rsp) accordingly:

# OMS host name
OMS_HOST=VM0112.vbox
# OMS upload port
EM_UPLOAD_PORT=4904
# Password for registering new agents
AGENT_REGISTRATION_PASSWORD=password1
# Base installation directory
AGENT_BASE_DIR=D:\app\oracle\product\agent12c
# Instance home directory
AGENT_INSTANCE_HOME=D:\app\oracle\product\agent12c\agent_inst
# Agent communication port
AGENT_PORT=3872
# Starts the agent after the install
b_startAgent=true
# Oracle home name
s_agentHomeName=agent12cR3
# Fully qualified host name where agent is to be installed
ORACLE_HOSTNAME=VM0201.vbox

Save these changes.

If you’re not sure on the ports, you can check these details by looking at the following file on your OMS:

$OMS_HOME/install/portlist.ini

…or by running the following emctl command:

$OMS_HOME/bin/emctl status oms -details

If you’ve got loads of Windows agents to deploy, then it’s probably worth editing the agent.rsp file at source instead (editing the copy within the zip file on the OMS), but I didn’t bother here as there were only a few to deploy.

Optionally (if not using DNS for example), add an entry into your hosts file for the OMS (C:\Windows\system32\drivers\etc\hosts)

# Oracle Enterprise Manager server
192.168.28.112     VM0112.vbox     VM0112

Check network port access

Next , check that the local Windows Firewall is either disabled or allows connectivity to the OMS server via the upload and agent ports (4904,3872 in this example).  In addition, make sure there are no other firewalls blocking connectivity.  You can do this tools like telnet, PortQry or PowerShell.  With recent versions of PowerShell, there is a Test-NetConnection cmdlet which does the job nicely…

PS C:\Users\oracle> Test-NetConnection -ComputerName VM0112.vbox -Port 3872

ComputerName : VM0112.vbox
RemoteAddress : 192.168.28.112
RemotePort : 3872
InterfaceAlias : Internal
SourceAddress : 192.168.28.201
PingSucceeded : True
PingReplyDetails (RTT) : 5 ms
TcpTestSucceeded : True

PS C:\Users\oracle> Test-NetConnection -ComputerName VM0112.vbox -Port 4904

ComputerName : VM0112.vbox
RemoteAddress : 192.168.28.112
RemotePort : 4904
InterfaceAlias : Internal
SourceAddress : 192.168.28.201
PingSucceeded : True
PingReplyDetails (RTT) : 4 ms
TcpTestSucceeded : True

Install the agent

Finally, execute the following batch file to deploy the agent from an Administrator Command Prompt (remembering to update ORACLE_HOSTNAME accordingly in your .rsp file):

agentDeploy.bat RESPONSE_FILE=D:\temp\12.1.0.3.0_AgentCore_233\agent.rsp

NOTE:  If you hit the “Invalid invocation. AGENT_BASE_DIR is mandatory.” error, you’ll need to edit the agentDeploy.bat script itself to include the following variable there too:

set agentBaseDir=D:\app\oracle\product\agent12c

Progress updates can be monitored through the Command Prompt window.

Here is the output from an 12.1.0.4.0 agent deployment as an example:

You might see an error like the one below part way through the install.  It’s nothing to worry about, just a permissions issue which can be safely ignored.  So just close the window by clicking on the ‘X’:

That’s it, agent deployed!  You should see the host and agent targets registered in Enterprise Manager shortly 🙂

You can check the status of the agent by running the following emctl command:

set AGENT_HOME=D:\app\oracle\product\agent12c
%AGENT_HOME%\agent_inst\bin\emctl status agent

References:
Installing Oracle Management Agent in Silent Mode
Installing Cygwin and Starting the SSH Daemon

 

5 thoughts on “EM12c agent installation for Windows hosts…without Cygwin!

  1. I ran into AGENT_BASE_DIR error and upon further reserach, I found the following. Please modifty uour posting to include this additional infor.

    “Unfortunately editing of the response file ist not enough. Also an entry of the AGENT_BASE_DIR value in the response file can’t protect the following error.
    Invalid invocation. AGENT_BASE_DIR is mandatory.
    What helps is an entry in the agentDeploy.bat itself”

    set agentBaseDir=E:\app\oracle\agent

    courtesy: http://www.carajandb.com/en/blogs/blog-swinkler-en/194-oem-12c-agent-deploy-on-windows-no-problem-without-cygwin

  2. Hello there,

    Thanks for the excellent post. Just an addition to complement your work. You can add that the agentDeploy.bat file has to be run in an Administrator Command Prompt logged on as a user who is a member of Administrators group. I believe it is trivial but would help someone who runs into the following error.

    INFO: SEVERE:Create service for service name:Oracleagent12cR4Agent has failed.

    Thanks

    • If the agent service is already installed – you need to delete it first (using sc delete Oracleagent12cR4Agent) or change the name of the agent service (not recommended)

      Hope it helps

  3. Great Post .
    Sometimes the agent’s installed manually will not be visible on OMS.
    Execute following to make the agent visible on OMS

    emctl config agent addinternaltargets

  4. Great! Got it working with the latest Agent 13.2 for the new (Oct 2016) Cloud Control.
    Very important to install telnet client on the Windows host, and check the access to OMS (“telnet omshost 4904”).
    Also, start the cmd.exe as administrator before starting the agent install.

    Thanks a lot!

Leave a Reply to Nos Cancel reply

Your email address will not be published. Required fields are marked *