Installing EM13c Agents on Microsoft Windows Target Hosts

If your EM13c OMS installed on Unix-based OS, and want to deploy agents to Windows servers, you need to install Cygwin to target windows server to use regular deployment process. You can also use PsExec utility but in this case, you need a Microsoft Windows staging server. Installing Cygwin to enable SSH on Windows may sound like an unnecessarily complex solution at first, but Cygwin is easy to install and it comes with lots of useful utilities. So It’s worth installing. In this blog, I’ll show how to deploy EM agent on Microsoft Windows target. I’ll download and install Cygwin to the target server, enable SSH service and create user for SSH. After these steps, I’ll use Enterprise Manager Add Host page to deploy Enterprise Manager agent to the target Windows server like it’s just another Linux host.

First login to the target Windows server with administrator user and download Cygwin from https://www.cygwin.com/install.html. Depending on your CPU architecture (is there any one still using 32bit?) you need to download setup-x86.exe or setup-x86_64.exe from the installation page. These are very small executables, and they will download the required packages from the internet.

cygwin2

When you run the setup-x86_64.exe, you see the welcome screen. You click NEXT to choose a download source. If your target server has no internet access, you can install packages from a local directory. That means, you can use the packages downloaded by another Cygwin installation on another server. All you need is to use a shared location or copy files from other server which is already Cygwin installed. Click NEXT to continue.

cygwin3

In this screen you set the installation path. Be careful that, Cygwin 64bit’s default installation path is “C:\Cygwin64”, but in “ssPaths_msplats.properties” file of Oracle Enterprise Manager, Cygwin path is defined as “C:\Cygwin” so So if you use a different path than “C:\Cygwin”, you need to modify all path variables in the file ($OMS_HOME\oui\prov\resources\ssPaths_msplats.properties). At first, I left it as it is, then I had to modify the “ssPaths_msplats.properties” file:

After setting the correct path, click NEXT button. It will ask you where it should download the packages, how your server connects to internet, which download site should be used. Usually it’s okay to accept the defaults until you see “select packages” screen.

cygwin7

All you need is to select “openssh and openssl” packages. So type “opens” into the search box, expand the “Net” category, and select the openssh and openssl packages. Cygwin installer will detect the additional required packages, just accept them and click NEXT until installation start, then wait for downloads and installations of packages are done.

After the installation is done, right-click on Cygwin64 Terminal icon on the desktop and choose “run as administrator”. So the terminal will start with admin rights.

Run ssh-host-config and give the following answers to the questions:

Query: Should StrictModes be used? (yes/no) yes
Query: Should privilege separation be used? (yes/no) yes
Query: new local account ‘sshd’? (yes/no) yes
Query: Do you want to install sshd as a service? yes
Query: Enter the value of CYGWIN for the daemon: []
Query: Do you want to use a different name? (yes/no) no
Query: Create new privileged user account ‘SQL01\cyg_server’ (Cygwin name: ‘cyg_server’)? (yes/no) yes
Query: Please enter the password: password
Query: Reenter: password

It should say “Host configuration finished” at the end. In my installation, it couldn’t find “cyg_server” for SSHD although it created, so it used “SYSTEM” user. That’s fine. Now open “C:\cygwin\etc\sshd_config” file (you can use vi or any other editor). Add the following line at the end of the time:

Then start SSH service:

For now, you do not have any users in Cygwin environment. I’ll add my current (local) user to the Cygwin environment so we’ll be able to use it when deploying agent.

As you can see I checked if there’s any line added to /etc/passwd. If you see your username there, you should be able to connect the target Windows server using SSH.

addtargets

Now we need to login to EM13c console, go to “Add Targets Manually” page, click “Install Agent on Host”.

addhost1

Enter host name and select the platform, click NEXT to go to “installation details” screen. Of course, you should have already installed the agent for Windows platform to be able to choose it on “the platform select box”.

addhost2

Enter the path in Windows format, for example: “C:\oracle\emagent”. Enter the username you added to “/etc/passwd” on the target Windows server. Click “NEXT” and deploy the agent. That’s all. Now we can deploy Microsoft SQL Server plugin to this agent and monitor our Microsoft SQL Servers, but I’ll tell it on another blog post 🙂

Please share
  •  
  •  
  •  
  • 8
  •  
  •  
  •  

Gokhan Atil is a database administrator who has hands-on experience with both RDBMS and noSQL databases, and strong background on software development. He is certified as Oracle Certified Professional (OCP) and is awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for his continuous contributions to the Oracle users community.

7 Comments

  1. Kees Schouten

    We did not want to install Cygwin and PsExec dit not work. Now we use the following solution:

    We copy the folder containing setup_agent_win64.exe and AgentDeploy.bat to d:\install\agent13c on the databasesserver
    We edit agent.rsp
    cd /d d:\install\agent13c
    agentdeploy.bat AGENT_BASE_DIR=D:\oracle\product\13.1.0\agent13c RESPONSE_FILE=d:\install\agent13c\agent.rsp

    Important: you have to use capitals, it will not work if you use agent_base_dir or response_file.

    • Ruslan

      Hi Kees,

      Before 13c I’ve had no problem with installing EM agent on Windows hosts. But now I’m getting error:

      Microsoft Windows [Version 6.3.9600]
      (c) 2013 Microsoft Corporation. All rights reserved.
      C:\Windows\system32>C:\INSTALL\13.2.0.0.0_AgentCore_233\agentDeploy.bat AGENT_BASE_DIR=C:\oracle\agent RESPONSE_FILE=C:\
      INSTALL\13.2.0.0.0_AgentCore_233\agent.rsp
      C:\INSTALL\13.2.0.0.0_AgentCore_233
      Present working directory:C:\INSTALL\13.2.0.0.0_AgentCore_233
      Archive location:C:\INSTALL\13.2.0.0.0_AgentCore_233 directory
      C:\oracle\agent
      Agent base directory:C:\oracle\agent
      Agent base directory:C:\oracle\agent
      OMS Host:
      Agent image loc : “C:\INSTALL\13.2.0.0.0_AgentCore_233”
      “Space available in AgentBaseDirectory is 82949 MB”
      C:\oracle\agent
      Reading the properties file: “C:\INSTALL\13.2.0.0.0_AgentCore_233″\agentimage.properties
      1 file(s) copied.
      This is the version 13.2.0.0.0
      This is the type agent
      This is the aru id 233
      “Validating the OMS_HOST & EM_UPLOAD_PORT”
      value of agenthome is “C:\oracle\agent\agent_13.2.0.0.0”
      Archive: C:/INSTALL/13.2.0.0.0_AgentCore_233/setup_agent_win64.exe
      inflating: C:/oracle/agent/Disk1/stage/Components/oracle.jre/1.7.0.111.0/DataFiles/filegroup1.jar
      “Validating the OMS_HOST & EM_UPLOAD_PORT”
      AGENT_ins home is:AGENT_BASE_DIR=C:\oracle\agentoraclehome is:C:\oracle\agent\agent_13.2.0.0.0
      The oraclehome C:\oracle\agent\agent_13.2.0.0.0
      Agent deployment log location: C:\oracle\agent\agent_13.2.0.0.0\cfgtoollogs\agentDeploy\agentDeploy_2016-11-17_17-05-06-
      PM.log
      Agent deployment completed successfully.
      “Validating OMS_HOST & EM_UPLOAD_PORT sucessfully.”
      1 file(s) copied.
      “The oracle home value should be set to C:\oracle\agent\agent_13.2.0.0.0”
      “C:\INSTALL\13.2.0.0.0_AgentCore_233\setup_agent_win64.exe -prereqChecker -entryPoint “oracle.sysman.top.agent_Complete”
      -silent -nowait -noconsole -ignoreSysPrereqs -detailedExitCodes -responseFile C:\oracle\agent\agentInstall.rsp -J-DORAC
      LE_HOSTNAME=oradev.ccb2.ru -J-Djava.io.tmpdir=C:\oracle\agent\agent_13.2.0.0.0\cfgtoollogs\prerelogs”
      “C:\INSTALL\13.2.0.0.0_AgentCore_233/setup_agent_win64.exe -silent -nowait -noconsole -responseFile C:\oracle\agent\agen
      tInstall.rsp”
      “ERROR: Agent installation failed.”
      C:\Windows\system32>

      Here is agent.rsp:

      OMS_HOST=192.0.3.155
      EM_UPLOAD_PORT=7799
      AGENT_REGISTRATION_PASSWORD=password
      AGENT_PORT=3872
      b_startAgent=true
      ORACLE_HOSTNAME=oradev.domain.local
      EM_INSTALL_TYPE=”AGENT”

  2. Gbenga A

    This is great write up Gokhan. At the moment, I don’t have a need to deploy 13c agent on a window server, but I’ll definitely check back to this blog if and when the time comes.

Leave Comment

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