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) | To Bottom |
In this Document
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. GOALTo 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. SOLUTIONIntroduction to Agent deploy using PsExecDeploying 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.
Instructions1) On the windows machine nominated to be the 'staging' server, download and extract pstools from the sysinternals Microsoft page:
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
----------------------------------------------- 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 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
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. 8) Obtain the agent image. Use the following command:
emcli get_agentimage -destination= 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 === 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 However, in the later release, 12.1.0.4.0_AgentCore_233.zip contains:
unizp.exe
which means that
$ORACLE_HOME /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 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 \\ 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
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 <<--This should be given for OMS_HOST parameter 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
Creating installation base directory ... 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
Creating installation base directory ... 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_ |