Control Oracle HTTP server with EM

A nice feature of EM is the metric gathering and control of Oracle HTTP server. If you follow the standard installation method provided by the Oracle ‘bugy’ wizards, you could have troubles with EM and oracle HTTP server.

Most of the time the HTTP server is not registered with the EM console to gather state information.

The reason:

[wc_dev_adminserver] [NOTIFICATION:32] [] [oracle.sysman.emas.sdk.discovery.discover.WeblogicTargetDiscovery] [tid: [ACTIVE].ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: fe7afd919a7a61df:-1896f1d5:13739376179:-8000-0000000000000ad7,0] [APP: em] Failed to get Attributes:[[javax.management.InstanceNotFoundException: Unable to contact MBeanServer fororacle.as.management.mbeans.register:type=SystemComponent,
name=/instance1/ohs1,instance=instance1,component=ohs1,
Location=AdminServer,EMTargetType=oracle_apacheĀ at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:205)

...

As you can see, the location of the OHS is not correct defined.

Solution:
We need to delete and redeploy the system components. Make sure AdminServer is up and running at the time you do this.
Run the commands below on the OHS server. Make sure you use your correct instancename.

cd /apps/oracle/middleware/Oracle_WT1/instances/instance1/bin

echo -n unregister the OHS in EM
./opmnctl unregisterinstance -instanceName ohs1 -adminHost 145.83.73.5 -adminPort 8100

echo -n redeply to the EM adminserver
./opmnctl redeploy -adminHost 145.83.73.5 -adminPort 8100

echo -n register instance in EM
./opmnctl registerinstance -adminHost 145.83.73.5 -adminPort 8100

The Result: