Showing posts with label emagent. Show all posts
Showing posts with label emagent. Show all posts

Friday, November 09, 2012

EM12c: How to change the EM Agent Port?

The EMAgent uses a particular port to receive requests from the OMS. This port number is defined by default when one installs the EMAgent on a target host.
If one needs to modify this port at some point, one can use the following steps.

To change the EMAgent port:

1. Stop the EMAgent.
$ $AGENT_HOME/bin/emctl stop agent

2. Modify the $AGENT_HOME/sysman/config/emd.properties file in the EMAgent home directory:
    For example:
    EMD_URL=http://abc.xyz.com:3872/emd/main

    Modify the <port number> in the EMD_URL property so the EMAgent uses a new unused port on the target host.
    EMD_URL=http://abc.xyz.com:3875/emd/main

3. Start the EMAgent.
$ $AGENT_HOME/bin/emctl start agent

Note:
With this port change the target name of agent will not change on OMS side, it will still show the original port. But it will work using the new port now as given below

$ ./emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 2 
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 12.1.0.2.0
OMS Version       : 12.1.0.2.0
Protocol Version  : 12.1.0.1.0
Agent Home        : /home/oracle/agent12c/agent_inst
Agent Binaries    : /home/user01/agent12c/core/12.1.0.2.0
Agent Process ID  : 5732
Parent Process ID : 5643
Agent URL         : https://abc.xyz.com:3875/emd/main/
Repository URL    : https://oms.xyz.com:4901/empbs/upload
Started at        : 2012-11-09 10:02:47
Started by user   : oracle
Last Reload       : (none)
Last successful upload                       : 2012-11-09 11:35:21
Last attempted upload                        : 2012-11-09 11:35:21
Total Megabytes of XML files uploaded so far : 0.2
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 64.97%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2012-11-09 11:37:11
Last successful heartbeat to OMS             : 2012-11-09 11:37:11
Next scheduled heartbeat to OMS              : 2012-11-09 11:38:11

---------------------------------------------------------------
Agent is Running and Ready

Wednesday, July 13, 2011

How to fix "java.lang.NoClassDefFoundError: oracle/jrf/PortabilityLayerException" ?

In EMGC 11 env., while monitoring FMW targets if you encounter following Error in emagent log:
2011-07-11 02:08:37,133 [nmefmgr_getJNIFetchlet] ERROR fetchlets.FabricFetchletWrapper logp.251 - Invocation Error in Fabric Fetchlet wrapper:
java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at oracle.sysman.emd.fetchlets.FabricFetchletWrapper.getMetric(FabricFetchletWrapper.java:109)
  at oracle.sysman.emd.fetchlets.FetchletWrapper.getMetric(FetchletWrapper.java:382)
...
Caused by: java.lang.NoClassDefFoundError: oracle/jrf/PortabilityLayerException
  at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupBean(EJBLocatorImpl.java:741)
  at oracle.soa.management.internal.ejb.EJBLocatorImpl.lookupFinderBean(EJBLocatorImpl.java:728)
  at oracle.soa.management.internal.ejb.EJBLocatorImpl.<init>(EJBLocatorImpl.java:165)
  at oracle.soa.management.facade.LocatorFactory.createLocator(LocatorFactory.java:35)
  at oracle.sysman.emd.fetchlets.FabricFetchlet.getLocator(FabricFetchlet.java:813)
  at oracle.sysman.emd.fetchlets.FabricFetchlet.getMetric(FabricFetchlet.java:194)
  ... 6 more
Caused by: java.lang.ClassNotFoundException: oracle.jrf.PortabilityLayerException
  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
  at oracle.sysman.emd.fetchlets.thirdparty.TPJMXFetchletClassLoader.loadClass(TPJMXFetchletClassLoader.java:78)
..
Reason: This error is appearing as emagent requires "jrf-api.jar" to be present in its CLASSPATH.

A simple workaround to fix the issue is:
1. Stop the agent
2. Add following jarfile to CLASSPATH property in emd.properties of emagent
$MW_HOME/oracle_common/modules/oracle.jrf_11.1.1/jrf-api.jar
where MW_HOME is the Middleware Home of FMW target .
3. Restart the agent.

Wednesday, June 15, 2011

EM11g - [nmefmgr_getJNIFetchlet] WARN JMX.generic logp.251 - IOException: cannot communicate to Target with serviceURL

EMagent is deployed on target host. Target WLS is discovered.
But only the general information about WLS is visible on EMUI. Monitoring details like JDBC, applications, JMS resources etc. are all empty.

emagentfetchlet.trc contains
2011-06-16 11:54:10,211 [nmefmgr_getJNIFetchlet] WARN  JMX.generic logp.251 - IOException: cannot communicate to Target with serviceURL=service:jmx:t3://hostname:6003/jndi/weblogic.management.mbeanservers.runtime for metric weblogic_j2eeserver:server_internal:: Couldn't connect to any host Cause: javax.naming.NamingException: Couldn't connect to any host [Root exception is org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203 completed: Maybe]

Action: Verify that Target Weblogic Server Domain->Advance settings should contain Platform MBean Server Enabled. Set 'PlatformMBeanServerEnabled' to True and restart the weblogic server.