Example of deploying a 12c Cloud Control Agent on a Windows machine using the PsExec method from a Windows Staging Server when the OMS is on Unix (Doc ID 1923499.1)Example of deploying a 12c Cloud Control Agent on a Windows (Doc ID 1923499.1)-LMLPHPTo BottomExample of deploying a 12c Cloud Control Agent on a Windows (Doc ID 1923499.1)-LMLPHP

Example of deploying a 12c Cloud Control Agent on a Windows (Doc ID 1923499.1)-LMLPHP

In this Document

Goal
Solution
 Introduction to Agent deploy using PsExec
 Instructions
References


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

APPLIES TO:

Enterprise Manager Base Platform - Version 12.1.0.3.0 to 12.1.0.4.0 [Release 12.1]
Information in this document applies to any platform.

GOAL

To show an example of how to use the PsExec method to deploy a 12.1.0.3 Cloud Control agent to a Windows machine when the OMS is on unix.

SOLUTION

Introduction to Agent deploy using PsExec

Deploying an agent using the PsExec method requires a 'staging' server. This 'staging server' is just a windows machine which hosts the agent software binaries and the install scripts and will not take up a large amount of resources. If the OMS is on windows, it would make sense for the 'staging server' to be the same machine as the OMS machine. However, If the OMS is on unix, then a separate windows machine is needed.  One of the advantages of using PsExec is that it can be used to deploy multiple agents (and does not require cygwin).

Note: This should *not* be the same machine as where you want to actually install the agent. This is because installing using PsExec involves copying the binaries across from the 'staging' machine to the intended agent machines. It would not make sense to use psexec to install an agent on the same machine as the staging server.  Therefore if the requirement is just to install one agent on one machine (without using cygwin), then just use a simple silent install method such asnote:1918878.1 "Example of Installing the 12c Agent on Windows Using the The AgentPull Script (AgentPull.bat)".   Notice that the method used to install/deploy the agent does not affect the subsequent functionality of the agent in any way.

Instructions

1) On the windows machine nominated to be the 'staging' server, download and extract pstools from the sysinternals Microsoft page:

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Extract into a directory to hold the pstool suite - eg.

c:\temp\pstools

During this article, this machine will be known as the 'staging server'

2) Ensure that this 'windows staging machine' can ping the remote machine where the agent will be deployed.  Also ensure that this machine can resolve its own ipaddress correctly (not to a localhost address or an ipv6 style address)

3) On the 'staging server', go to control panel/system/advanced system settings/click on "environmental variables", under 'system variables'

edit path and add:

c:\temp\pstools;

to the beginning of the path

4) Launch a fresh windows command prompt as 'administrator', and type:

psexec

at the command prompt.  Check that the psexec banner is displayed and agree to the license terms.

5) It is now necessary to obtain the agent software and put it on the staging server.  The agent software is obtained from the OMS using Emcli.  Emcli is automatically installed into the $ORACLE_HOME of the OMS.  (Alternatively EMCLI  can be downloaded and run from the 'staging server' machine itself).  In this example, the default Emcli (from the unix OMS home) will be used.

Connect to the machine where the OMS is:

If the OMS is on unix, type "which zip", and export ZIP_LOC to the location of zip. For example:

which zip
/usr/bin/zip
export ZIP_LOC=/usr/bin/zip

 6) Still on the OMS machine, set ORACLE_HOME to the home of the OMS, and log into emcli

emcli login -username=sysman -password=oracle12

7) Run the following emcli command to get a list of the agent software available to be deployed for each platform:

emcli get_supported_platforms

-----------------------------------------------
Version = 12.1.0.3.0
Platform = Linux x86
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.2.0
Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Version = 12.1.0.2.0
Platform = Microsoft Windows (32-bit)
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Oracle Solaris on x86-64 (64-bit)
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Microsoft Windows (32-bit)
-----------------------------------------------
Version = 12.1.0.3.0
Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

In this example, there are numerous platforms available, but if this is a new install of the OMS by default only the platform of the OMS will be available. Make sure that the right Windows platform (32 or 64 bit) is available (for the machine where the agent needs to be deployed to) 

Tip: to find out whether the windows system is 64 or 32 bit:

start/control panel/system
under the "system" section
check "system type"

If the relevant Windows platform (32 or 64 bit) is not listed, it will need to be downloaded via self update.

Tip: To download from self update

setup/Extensibility/Self Update
click on "Agent Software"
Software which shows as "Applied" should have been returned by the "showPlatforms" command above.
Software which has not yet been downloaded to the OMS should show as "Available"

Highlight the platform which is needed (eg. Microsoft Windows (64 bit).) Note that listed here, are different versions of the agent. Make sure that the latest one is selected.
Click on "Download" and select "immediately", the status should change to "Download in Progress". It can take over 10 minutes to download.
When the status changes to "downloaded", highlight it and click on "apply"
The status will now change to "Available".  Now repeat the emcli get_supported_platforms command. 

8) Obtain the agent image.  Use the following command:

emcli get_agentimage -destination= -platform= -version= 

for example:

[oracle@machine1 tmp]$ emcli get_agentimage -destination=/tmp/winAgent12103 -platform="Microsoft Windows x64 (64-bit)" -version=12.1.0.3.0

=== Partition Detail ===
Space free : 217 GB
Space required : 1 GB
Check the logs at /oracle/12c/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2014-08-29_12-14-35-PM.log
Downloading /tmp/winAgent12103/12.1.0.3.0_AgentCore_233.zip
File saved as /tmp/winAgent12103/12.1.0.3.0_AgentCore_233.zip
Downloading /tmp/winAgent12103/12.1.0.3.0_PluginsOneoffs_233.zip
File saved as /tmp/winAgent12103/12.1.0.3.0_PluginsOneoffs_233.zip
Downloading /tmp/winAgent12103/unzip
File saved as /tmp/winAgent12103/unzip
Agent Image Download completed successfully.
[oracle@machine1 tmp]$

This results in the file 12.1.0.3.0_AgentCore_233.zip or 12.1.0.4.0_AgentCore_233.zip being generated (depending on the version of the OMS).  The file will be generated in the destination specified which is /tmp/winAgent12103 in this example.

9) This extra step is needed for 12.1.0.3 OMS only (if using 12.1.0.4 OMS, go to step 10)

A) Notice that if the files are viewed which make up the resulting zip file:

12.1.0.3.0_AgentCore_233.zip contains:

tmp
agent.rsp
agentcoreimage.zip
agentDeploy.bat
agentimage.properties
unzip.exe

However, in the later release, 12.1.0.4.0_AgentCore_233.zip contains:

unizp.exe
agentDeploy.bat
agentimage.properties
agent.rsp
agentcoreimage.zip
12.1.0.4.0_PluginsOneoffs_233.zip

which means that _PluginsOneoffs_233.zip is missing for the 12.1.0.3 release.  For 12.1.0.3 the 12.1.0.3.0_PluginsOneoffs_233.zip can be found at:

$ORACLE_HOME/install/agentImage  for example:

/oracle/12c/12ccloud/oms/install/agentImage

-rwxr-xr-x 1 oracle oinstall 6626099 Aug 29 11:37 ./install/agentImage/12.1.0.3.0_PluginsOneoffs_233.zip

B) Copy or move the following files:

12.1.0.3.0_PluginsOneoffs_233.zip and
12.1.0.3.0_AgentCore_233.zip

from the OMS machine to the windows 'staging' machine.  

Note if Emcli was installed on the 'windows staging machine', the files would be downloaded directly to that machine and it would not be necessary to copy across.  In this example EMCLI is launched on the remote Unix OMS machine so it's necessary to copy or move the files

C) It is now necessary to merge the 12.1.0.3.0_PluginsOneoffs_233.zip and 12.1.0.3.0_AgentCore_233.zip into one zip file as follows:

i) extract 12.1.0.3.0_AgentCore_233.zip to c:\temp\winagent

ii) copy 12.1.0.3.0_PluginsOneoffs_233.zip to c:\temp\winagent (but don't extract just copy so that it remains a zip file)

The directory c:\temp\winagent should look like this:

08/29/2014 06:56 PM .
08/29/2014 06:56 PM ..
08/29/2014 06:51 PM 6,626,099 12.1.0.3.0_PluginsOneoffs_233.zip
06/22/2013 09:46 PM 3,839 agent.rsp
06/22/2013 09:46 PM 257,743,299 agentcoreimage.zip
06/22/2013 09:46 PM 8,768 agentDeploy.bat
06/22/2013 09:45 PM 206 agentimage.properties
06/22/2013 09:46 PM 167,936 unzip.exe
6 File(s) 264,550,147 bytes
2 Dir(s) 33,639,047,168 bytes free

iii) Now zip up this directory so it's called:

12.1.0.3.0_AgentCore_233.zip

iv) Copy 12.1.0.3.0_AgentCore_233.zip to c:\temp\agentStage

10) For 12.1.0.4 it is not necessary to follow step 9.   For 12.1.0.4, copy or move 12.1.0.4.0_AgentCore_233.zip from the OMS machine to the Windows Staging Server and put into c:\temp\agentStage

11) Use note:1636851.1 to download the agentDeployPSExec.bat script (contact Support to obtain access to this script).  Download this onto the windows staging machine and put it into:

c:\temp\agentStage

For example:

c:\temp\agentStage\agentDeployPSExec.bat

12) Perform the following test, to check that the Microsoft PsExec command works ok:

On the 'windows staging' machine, create a file in c:\temp\agentStage called test.bat.

contents of test.bat
================
echo this is a test

Run the following test:

C:\TEMP\agentStage>psexec.exe \\ -u -p -d -c C:\TEMP\agentStage\\test.bat

For example:

C:\TEMP\agentStage>psexec.exe \\winpc.uk.oracle.com -u Administrator -p adminTest -d -c C:\TEMP\agentStage\\test.bat

PsExec v2.11 - Execute processes remotely
Copyright (C) 2001-2014 Mark Russinovich
Sysinternals - www.sysinternals.com


test.bat started on winpc.uk.oracle.com with process ID 18216.

If this test does not work, then do not continue, but investigate any problems with psexec with Microsoft.

13) Create a properties/input file which will be used to deploy the agent.  In this example, the properties file is called input1.txt and is created in c:\temp\agentStage 

HOST_NAMES=
USER_NAME=
PASSWORD=
AGENT_IMAGE_PATH=
AGENT_BASE_DIR=
OMS_HOST=
EM_UPLOAD_PORT=
AGENT_REGISTRATION_PASSWORD=
PSEXEC_DIR=
REMOTE_SYS_DIR=c:\Windows*

 

*The documentation states that REMOTE_SYS_DIR can be set to c:\Windows or C:\Windows\System32.  It should be set to the location of SystemRoot. To find out the location of systemRoot type "set SystemRoot".  For example:

C:\Users\Administrator>set SystemRoot
SystemRoot=C:\Windows

For this example, the contents of c:\temp\agentStage\input1.txt are:

HOST_NAMES=winpc.uk.oracle.com
USER_NAME=Administrator
PASSWORD=adminTest
AGENT_IMAGE_PATH=C:\temp\agentStage\12.1.0.3.0_AgentCore_233.zip
AGENT_BASE_DIR=C:\12ctestagent
OMS_HOST=machine1.uk.oracle.com
EM_UPLOAD_PORT=4901
AGENT_REGISTRATION_PASSWORD=oracle12
PSEXEC_DIR=C:\temp\psTools
REMOTE_SYS_DIR=c:\Windows 

 Note the following:

Tip: If unsure about the port of the oms run the following command on the oms machine

emctl status oms -details

This will give the following output:

Console Server Host : machine1.uk.oracle.com <
HTTP Console Port : 7789
HTTPS Console Port : 7801 
HTTP Upload Port : 4890 
HTTPS Upload Port : 4901 <

14) On the 'windows staging' machine, launch the command prompt as administrator and cd to:

C:\temp\agentStage

Run the command:

agentDeployPSExec.bat PROPERTIES_FILE=c:\temp\agentStage\input1.txt

15)  If the message is generated:

C:\TEMP\agentStage>echo off
"Error : Unzip binary C:\TEMP\agentStage\\unzip.exe does not exist"

Action: Then extract unzip.exe from the C:\temp\agentStage\12.1.0.3.0_AgentCore_233.zip, so that unzip.exe exists in c:\temp\agentStage and run step 14 again.

16) If the message is generated:

c:\TEMP\agentStage>echo off
===================================================================
Agent deployment started on host : winpc.uk.oracle.com

Creating installation base directory ...
Copying unzip to the target host ...
Copying agent software to the target host ...
"Command C:\temp\psTools\psexec.exe \\winpc.uk.oracle.com -u Administrator -p ****** cmd.exe /c move c:\Windows\system32\12.1.0.3.0_AgentCore_233.zip
C:\12ctestagent\ADATMP_2014-09-05_5-03-34 failed. Refer log C:\TEMP\agentStage\agentDeployPsExec_2014-09-05_5-03-34.log for more details" 

Action:Change the REMOTE_SYS_DIR parameter in the properties file (input1.txt) from c:\windows\system32 to c:\windows

17) During a successful agent deploy, the following output should be generated:

C:\TEMP\agentStage>agentDeployPSExec.bat PROPERTIES_FILE=c:\temp\agentStage\input1.txt

C:\TEMP\agentStage>echo off
===================================================================
Agent deployment started on host : winpc.uk.oracle.com

Creating installation base directory ...
Copying unzip to the target host ...
Copying agent software to the target host ...
Extracting agent software ...
Installing agent ....
Performing clean up ...

Agent deployment completed successfully on host : winpc.uk.oracle.com

18) If there are any problems with the install, check the log file that is generated on the 'staging server' machine in C:\TEMP\agentStage\agentDeployPsExec_.log

10-04 02:34