All roads lead to agentdeploy



Over 12 months ago now i wrote a short summary of manually installing a cloud control agent - that post is here. Revisiting that this week with a fresh batch of installs i had a look again at the options that are available to do installs in general - there are of course 2 main categories:

1) GUI
2) command line

I'm ignoring any shared options or cloning for the purposes of this post.

GUI speaks for itself and I'm not going to mention that further. However the command line option has a few sub-options that i though it's worth discussing further.

The previous post just covered running the agentdeploy script once you had the agent software on the target server. However there is more than one way to get to that point and trigger that process and I thought it would be useful to share a bit more on this topic.

I'll cover 3 main command line options (there is a 4th using rpm's but with my access to our systems I didn't bother trying that one)

1) emcli
2) getAgentimage
3) manual 'fudge'

All of these 3 sub-options ultimately call agentdeploy.sh in one way or another so i won't cover old ground at the end on that topic (the post above can deal with that). I'll just cover how you can get to that point in different ways.

So first up option 1 "emcli"

Now from the previous post you can see that emcli was used on the OMS host to extract the agent software. emcli can though be run from anywhere - it just needs to be installed and configured. It's not there by default and does need to be set up (don't confuse this with emctl - emcli is a command line version of the cloud control console and has a huge amount of functionality).

To install emcli you simply need to download it from with the management repository - there are a couple of screen that explain what to do with it - so from the home page navigate here


And you'll see this screen

If you right click the link you can see where it points to - which should be
http://oms-hostname:7788/em/public_lib_download/emcli/kit/emclikit.jar

I'm running on linux so i then use wget to fetch this file

wget http://oms-hostname:7788/em/public_lib_download/emcli/kit/emclikit.jar
--17:38:50--  http://oms-hostname:7788/em/public_lib_download/emcli/kit/emclikit.jar
           => `emclikit.jar'
Resolving oms-server... 10.10.10.10
Connecting to oms-server|10.10.10.10|:7788... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]

    [ <=>                                                                                                                                                      ] 2,521,837     12.80M/s

17:38:50 (12.79 MB/s) - `emclikit.jar' saved [2521837]


So i now have a local copy on my target server - i now need to initialize it (you'll need a java 6 installation on your target server by the way)

java -jar emclikit.jar -install_dir=/tmp
Oracle Enterprise Manager 12c Release 4.
Copyright (c) 2012, 2014 Oracle Corporation.  All rights reserved.

EM CLI client-side install completed successfully.
Execute "emcli help setup" from the EM CLI home (the directory where you have installed EM CLI) for further instructions.


So now it's installed we need to configure it

emcli setup -url=http://oms-server.e-ssi.net:7788 -username=sysman
Oracle Enterprise Manager 12c Release 4.
Copyright (c) 1996, 2014 Oracle Corporation and/or its affiliates. All rights reserved.

Enter password

Emcli setup successful


So now emcli is setup we can use it to run the same command to download the agent software i used in the original post

emcli get_agentimage -destination=/tmp/rich -platform="Linux x86-64" -version=12.1.0.4.0
 === Partition Detail ===
Space free : 4 GB
Space required : 1 GB
Check the logs at /oracle/home/oracle/.emcli/get_agentimage_2014-09-08_19-18-43-PM.log
Downloading /tmp/rich/12.1.0.4.0_AgentCore_226.zip
File saved as /tmp/rich/12.1.0.4.0_AgentCore_226.zip
Downloading /tmp/rich/12.1.0.4.0_PluginsOneoffs_226.zip
File saved as /tmp/rich/12.1.0.4.0_PluginsOneoffs_226.zip
Downloading /tmp/rich/unzip
File saved as /tmp/rich/unzip
Agent Image Download completed successfully.
oracle@server:/tmp>


SO now we're at the point we can install with agentdeploy.sh - at this point i'll move on....

Option 2 "getagentimage"

This is very similar to option1 in many ways - you download a file from the OMS and then use this to download and (optionally) install the agent

First up we donwload the magic shell script (again wth wget)

wget http://oms-server:7788/em/install/getAgentImage
--19:21:11--  http://oms-server:7788/em/install/getAgentImage
           => `getAgentImage'
Resolving oms-server... 10.10.10.10
Connecting to oms-server|10.10.10.10|:7788... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21,161 (21K) [application/octet-stream]

100%[=========================================================================================================================================================>] 21,161        --.--K/s

19:21:11 (936.09 KB/s) - `getAgentImage' saved [21161/21161]


oracle@server:/tmp>

Then we give exec permissions

oracle@server:/tmp> chmod +x getAgentImage






Now we can run it to show which agent software can be downloaded/installed

oracle@server:/tmp> ./getAgentImage -showPlatforms


Platforms       Version
Linux x86       12.1.0.3.0
Linux x86-64    12.1.0.3.0
IBM AIX on POWER Systems (64-bit)       12.1.0.3.0
Linux x86-64    12.1.0.4.0
Linux x86-64    12.1.0.1.0


Using the various switches we can now pull the software down using the download_only flag ( it will by default try and install the agent also)

./getAgentImage LOGIN_USER=sysman LOGIN_PASSWORD=password PLATFORM="Linux x86-64" VERSION=12.1.0.4.0 -download_only

/bin/chmod: changing permissions of `/tmp': Operation not permitted

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  237M  100  237M    0     0  40.1M      0  0:00:05  0:00:05 --:--:-- 44.6M
test of /tmp/agent.zip OK
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7939k  100 7939k    0     0  2417k      0  0:00:03  0:00:03 --:--:-- 3605k
Command: /usr/bin/curl  https://oms-server.e-ssi.net:4901/em/install/getAgentImage?user=sysman&platform=Linux x86-64&version=12.1.0.4.0&script=download&host=server&type=pluginimage --insecure -o /tmp/plugin.zip -S --stderr /tmp/error.txt
test of /tmp/plugin.zip OK
  adding: plugin.zip (stored 0%)
Agent image downloaded successfully.


A quick check shows

ls -l

-rw-r--r-- 1 oracle oinstall 256914932 2014-09-08 19:28 agent.zip


And again we are at the point where agentdeploy.sh can be used

Finally "option 3" - the manual fudge

To be honest this was my original plan before i realised that option 1 and option 2 did a lot of the work for me......

In this case i downloaded the agent software onto the OMS server using emcli - and i then had to work out where to put this file under the oracle apache install to be able to just download it directly with wget :-)

I finally discovered i had to copy the file to

/oracle/gc_inst12104/WebTierIH1/config/OHS/ohs1/htdocs

once it was there i could fetch the file with

wget http://oms-server:7788/agentlinux64.zip
--21:14:57--  http://oms-server:7788/agentlinux64.zip
           => `agentlinux64.zip'
Resolving oms-server... 10..10.10.10
Connecting to oms-server|10.10.10.10|:7788... connected.
HTTP request sent, awaiting response... 200 OK
Length: 256,914,996 (245M) [application/zip]

100%[=========================================================================================================================================================>] 256,914,996   20.44M/s    ETA 00:00

21:15:26 (8.38 MB/s) - `agentlinux64.zip' saved [256914996/256914996]



And again we are at the point where agentdeploy can be used



So there you have it 3 different ways to get to the same end goal - not sure which i prefer to be honest - i'll leave the choice up to you.........


0 comments:

Post a Comment