Showing posts with label OEM13c Release 2. Show all posts
Showing posts with label OEM13c Release 2. Show all posts

Useful emcli commands in EM Cloud Control 12c

 you to realize useful operation in EM Cloud Control 12c using emcli tool rather than GUI.

You can use emcli when you need to implement batch scripts on your Oracle Management Server (OMS).
  • Login to EM
$ emcli login -username=sysman
Enter password :
Login successful
OR
$ emcli login -username=sysman -password=XXXXXX
Login successful
  • Synchronize emcli with the OMS
$ emcli sync
Synchronized successfully
  • Logout EM
$ emcli logout
Logout successful
  • List all the targets already promoted
$ emcli get_targets
Status  Status           Target Type           Target Name
 ID
-9      n/a              group                 OFM
1       Up               host                  xxxdb-prod3.mydomain.com
1       Up               host                  xxxdb-prod2.mydomain.com
1       Up               host                  xxxlgc-prod2.mydomain.com
1       Up               host                  xxxdb-prod1.mydomain.com
1       Up               j2ee_application      /EMGC_GCDomain/GCDomain/EMGC_OMS1/e
                                               mgc
1       Up               j2ee_application      /EMGC_GCDomain/GCDomain/EMGC_OMS1/O
                                               CMRepeater
1       Up               j2ee_application      /EMGC_GCDomain/GCDomain/EMGC_OMS1/e
                                               mpbs
-9      n/a              metadata_repository   /EMGC_GCDomain/GCDomain/EMGC_ADMINS
                                               ERVER/mds-sysman_mds
-9      n/a              metadata_repository   /EMGC_GCDomain/GCDomain/EMGC_ADMINS
                                               ERVER/mds-owsm
1       Up               oracle_apache         /EMGC_GCDomain/instance1/ohs1
1       Up               oracle_apm            /EMGC_GCDomain/GCDomain/EMGC_OMS1/o
                                               racle.security.apm(11.1.1.3.0)
1       Up               oracle_beacon         EM Management Beacon
1       Up               oracle_em_service     EM Console Service
1       Up               oracle_em_service     EM Jobs Service
1       Up               oracle_emd            xxxdb-prod1.mydomain.com:1830
1       Up               oracle_emd            xxxdb-prod3.mydomain.com:1830
1       Up               oracle_emd            xxxlgc-prod2.mydomain.com:3872
1       Up               oracle_emd            xxxdb-prod2.mydomain.com:1830
1       Up               oracle_emrep          Management Services and Repository
-9      n/a              oracle_home           agent12g1_9_xxxlgc-prod2
-9      n/a              oracle_home           WebLogicServer10_3_5_0_0_xxxlgc-pro
                                               d2
-9      n/a              oracle_home           oms12g1_3_xxxlgc-prod2
-9      n/a              oracle_home           webtier12g1_20_xxxlgc-prod2
-9      n/a              oracle_ias_farm       EMGC_GCDomain
1       Up               oracle_oms            xxxlgc-prod2.mydomain.com:4889_Managem
                                               ent_Service
1       Up               oracle_oms_console    xxxlgc-prod2.mydomain.com:4889_Managem
                                               ent_Service_CONSOLE
1       Up               oracle_oms_pbs        xxxlgc-prod2.mydomain.com:4889_Managem
                                               ent_Service_PBS
-9      n/a              weblogic_domain       /EMGC_GCDomain/GCDomain
1       Up               weblogic_j2eeserver   /EMGC_GCDomain/GCDomain/EMGC_OMS1
1       Up               weblogic_j2eeserver   /EMGC_GCDomain/GCDomain/EMGC_ADMINSERVER
  • Delete a specific target
$ emcli delete_target -name="/wlstest_wlstest/wlstest/myServer_jvm" -type="java_virtual_machine"
  • Delete an agent and its targets
$ emcli delete_target -name="xxxlgc-prod2.mydomain.com:3872" -type="oracle_emd" -delete_monitored_targets
  • Follow a plugin deployment (on the OMS / on an agent)
-- Oracle Database plugin
$ emcli get_plugin_deployment_status -plugin_id=oracle.sysman.db
-- Oracle Fusion Middleware plugin
$ emcli get_plugin_deployment_status -plugin_id=oracle.sysman.emas
-- My Oracle Support plugin
$ emcli get_plugin_deployment_status -plugin_id=oracle.sysman.mos
  • Import an update (for example: a plugin update) into the software library.
$ emcli import_update -file="p14018177_112000_Generic.zip" -omslocal
  • Deploy a plugin on the OMS
$ emcli deploy_plugin_on_server -plugin=oracle.sysman.db -sys_password=XXXXX
  • Deploy a plugin on EM agent(s)
$ emcli deploy_plugin_on_agent -plugin="oracle.sysman.db"  -agent_names="xxxdb-prod1.mydomain.com:3872;xxxdb-prod2.mydomain.com:3872"
  • List available agents in the library
$ emcli get_supported_platforms
Getting list of platforms ...
Check the logs at /home/oracle/agent.log
About to access self-update code path to retrieve the platforms list..
Getting Platforms list ...
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Linux x86
-----------------------------------------------
Version = 12.1.0.1.0
Platform = IBM AIX on POWER Systems (64-bit)
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Microsoft Windows (32-bit)
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Microsoft Windows (64-bit)
-----------------------------------------------
Platforms list displayed successfully
  • Download an agent from the library (used for agentDeploy.sh script method)
$ emcli get_agentimage -destination=/home/oracle -platform="Microsoft Windows x64 (64-bit)" -version="12.1.0.1.0"
Platform:Microsoft Windows x64 (64-bit)
Destination:/home/oracle
=== Partition Detail ===
Space free : 11 GB
Space required : 1 GB
Check the logs at /home/oracle/get_agentimage_2012-06-11_15-18-09-PM.log
Setting property ORACLE_HOME to:/u02/Middleware/oms
calling pulloneoffs with arguments:/u02/Middleware/oms/u02/softLibrary/32/C0C9BF40C6A36668E0439D33010AE58512.1.0.1.0windows_x64
Check this logs for more information: /u02/Middleware/oms/sysman/prov/agentpush/logs
  • Set monitoring credentials for a specific target (example given for an Oracle database instance)
$ emcli set_credential -target_type=oracle_database -target_name="prod1" -credential_set=DBCredsMonitoring -user=sysman -column="Role:SYSDBA;UserName:sys;password:XXXXX" -monitoring
Advertisements

Remove the target from EM manually using the emcli

  • 1- On your main Enterprise Manager Repository logon to your emcli utility.

  • 2- Once conected run the sync command:

  • 3 – Now let’s remove the target manually using the emcli command line utility:

Done

DIRECTORY STRUCTURE AND LOCATIONS OF IMPORTANT TRACE AND LOG FILES OF ENTERPRISE MANAGER CLOUD CONTROL 13C


Because of the size and complexity of the Enterprise Manager Cloud Control software, while browsing through the folders on OMS server, you may feel confused and think that everything is in complete disorder. In fact, the directory structure of EM13c is quite simple. During EM13c installation (“advanced mode”), the installer expects you to enter the folder names:
  • Middleware home location (MW_HOME)
  • OMS instance base location (EM_INSTANCE_BASE)
  • Agent base location
Depending on your inputs, the installer will create a directory structure similar to the below one:
Middleware Home/u01/oracle/Middleware
EM Instance Baseu01/oracle/gc_inst
Agent Base/u01/oracle/emagent
EM Instance Home/u01/oracle/gc_inst/em/EMGC_OMS1
EM NodeManager/u01/oracle/gc_inst/user_projects/domains/GCDomain/nodemanager
Middleware Common/u01/oracle/Middleware/oracle_common
Weblogic Domain Home/u01/oracle/gc_inst/user_projects/domains/GCDomain
Admin Server/u01/oracle/gc_inst/…./servers/EMGC_ADMINSERVER
EM Managed Server/u01/oracle/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1
BI Publisher/u01/oracle/gc_inst/user_projects/domains/GCDomain/servers/BIP
OHS/u01/oracle/gc_inst/user_projects/domains/GCDomain/servers/ohs1
Agent Instance Home/u01/oracle/emagent/agent_inst
As you may notice, there are slight differences between directory structures of EM12c and EM13c. For example, in EM13c, there is no separate folder called “oms” in the middleware home. Therefore the binaries located in OMS folder (such as emctl) are now located in the “bin” folder in the Middleware home. Oracle_WT is also merged into the middleware home.
Knowing the directory structure helps you to access the important trace and log files of EM13c. Here’s the trace and log files you may use to diagnose problems about EM13c.

The Trace and Log Files of OMS:

The Oracle Management Service has two applications: OMS Console (emgc) and OMS Platform (empbs). The trace and log files of these applications are located in “sysman/log” directory in the EM Instance Home (for example: /u01/oracle/gc_inst/em/EMGC_OMS1/sysman/log ). These logs are very useful to diagnose OMS related problems.
  • emoms.log The main log file for the OMS Console (emgc) application.
  • emoms.trc The main trace file for the OMS Console (emgc) application.
  • emoms_pbs.log The main log file for the OMS pbs (empbs) application.
  • emoms_pbs.trc The main trace file for the OMS pbs (empbs) application.
  • secure.log This log provides additional logs for “emctl secure oms” command.
  • emctl.log This log contains OMS startup/shutdown details.
  • emctl.msg This log is created by the OMS HealthMonitor thread, when it re-starts the OMS due to a critical error.

The Trace and Log Files of EM Managed Server:

EM Managed Server is the weblogic server hosting OMS applications. The logs are located in “logs” directory in EM Manager Server Home folder (for example: /u01/oracle/gc_inst/user_projects/domains/GCDomain/servers/EMGC_OMS1/logs):
  • EMGC_OMS1.log: The EMGC_OMSn instance writes all messages from its subsystems and applications to this logfile.
  • EMGC_OMS1.out: The messages written to sysout and syserr are saved in this file by the nodemanager. This log file is rotated by the nodemanager only at the time of Managed server start, and older files need to be manually purged.
  • access.log: This log file contains details of HTTP requests processed by EM Managed Server.
  • EMGC_OMS1-diagnostic.log: This log file contains application-related security errors.

The Trace and Log Files of Oracle HTTP Server (OHS)

Oracle HTTP Server (OHS) is the web server component of EM13c. It works as a reverse proxy for Oracle WebLogic Server and the framework for hosting static pages. It’s located in “logs” folder in the “OHS Home” (/u01/oracle/gc_inst/user_projects/domains/GCDomain/servers/ohs1/logs):
  • access_log: Access logs stores all the client requests. The HTTP Response code is useful in identifying whether the client request was successful or not.
  • ohs1.log: This is the error log for the OHS.
  • admin_log: This log file keeps Oracle Dynamic Monitoring Service (DMS) requests.
  • em_upload_http_access_log: The log file contains entries for Agent uploads in http mode.
  • em_upload_https_access_log: The log file contains entries for Agent uploads in https mode.

The Trace and Log Files of EM Agents:

The agent log files are located in the “sysman/log” folder in the “Agent Instance Home” (for example: /u01/oracle/emagent/agent_inst/sysman/log).
  • gcagent.log: This log file contains trace, debug, information, error, or warning messages from the Agent. It can be used for debugging Agent framework issues.
  • gcagent_errors.log: It’s similar to the gcagent.log but it contains only the log messages of ERROR and FATAL levels. The log has no size limit.
  • emagent.nohup: Nohup logs of the agent. This log contains startup and shutdown messages including JVM flags. It can be used to determine when the agent is down, and the errors generated on startup of shutdown can be examined with this log.
  • gcagent_mdu.log: This log tracks the metadata updates (such as save or remove targets, blackouts, deployments of metric extensions) to the Agent.
  • gcagent_sdk.trc: The gcagent_sdk.trc file contains log messages from each of the plugins and can be used for debugging plugin related issues.
  • emctl.log: emctl.log provides logging for emctl commands.
  • emdctlj.log: emdctlj.log contains logging for the entry point and the exit codes of the emctl commands.
  • secure.log: This log provides additional logs for “emctl secure agent” command, and can be useful to diagnose failures during securing of the Agent.
  • emagent_perl.trc: Trace file for the PERL scripts. EM uses perl scripts to gather some metrics and target discovery. The log level can be changed by modifying EMAGENT_PERL_TRACE_LEVEL variable in “sysman/config/emd.properties” file.


Post from "Orignal Post "