Skip Headers
Oracle® Enterprise Manager Cloud Control Administrator's Guide
12c Release 1 (12.1.0.1)

Part Number E24473-15
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

17 Starting and Stopping Enterprise Manager Components

This chapter explains how to use the Enterprise Manager command line utility (emctl) to start and stop the Management Service, the Management Agent, and Cloud Control.

This chapter also explains the various emctl commands for Management Service and Management Agent and how to use log information to troubleshoot emctl.

Following are the sections in this chapter:

Controlling the Oracle Management Agent

The following sections describe how to use the Enterprise Manager command line utility (emctl) to control the Oracle Management Agent:

Starting, Stopping, and Checking the Status of the Management Agent on UNIX

When you start the agent on UNIX systems, it starts the parent watchdog process and the child Java process for the agent. The watchdog monitors the agent Java process and attempts to start it if it fails abnormally.

To start, stop, or check the status of the Management Agent on UNIX systems:

  1. Change directory to the AGENT_INSTANCE_HOME/bin directory.

  2. Use the appropriate command described in Table 17-1.

    For example, to stop the Management Agent, enter the following commands:

    $PROMPT> cd AGENT_INSTANCE_HOME/bin
    $PROMPT> emctl stop agent
    

Table 17-1 Starting, Stopping, and Checking the Status of the Management Agent

Command Purpose

emctl start agent

Starts the Management Agent

emctl stop agent

Stops the Management Agent

emctl status agent

If the Management Agent is running, this command displays status information about the Management Agent, including the Agent Home, the process ID, and the time and date of the last successful upload to the Management Repository ().


Example 17-1 Checking the Status of the Management Agent

$ emctl status agent
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0  
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version     : 12.1.0.1.0
OMS Version       : 12.1.0.1.0
Protocol Version  : 12.1.0.1.0
Agent Home        : /ade/jexample_username/oracle/work/agentStateDir
Agent Binaries    : /scratch/user/view_storage/example_username/emagent/gcagent/agent
Agent Process ID  : 22299
Parent Process ID : 22226
Agent URL         : https://example.us.oracle.com:11852/emd/main/
Repository URL    : https://example.us.oracle.com:14487/empbs/upload
Started at        : 2011-08-09 06:19:12
Started by user   : user
Last Reload       : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 787
Size of XML files pending upload(MB)         : 2.21
Available disk space on upload filesystem    : 47.91%
Collection Status                            : Collections enabled
Last attempted heartbeat to OMS              : 2011-08-09 06:20:51
Last successful heartbeat to OMS             : (none)
 
---------------------------------------------------------------

On IBM AIX environment with a large memory configuration where the Management Agent is monitoring a large number of targets, the Agent may not start. To prevent this issue, prior to starting the Management Agent, add the following parameters to the common environment file:

LDR_CNTRL="MAXDATA=0x80000000"@NOKRTL

AIX_THREADSCOPE=S

The LDR_CNTRL variable sets the data segment size and disables loading of run time libraries in kernel space. The AIX_THREADSCOPE parameter changes AIX Threadscope context from the default Processwide 'P' to Systemwide 'S'. This causes less mutex contention.

Starting and Stopping the Management Agent on Windows

When you install the Oracle Management Agent on a Windows system, the installation procedure creates one new service in the Services control panel.

The procedure for accessing the Services control panel varies, depending upon the version of Microsoft Windows you are using. For example, on Windows 2000, locate the Services Control panel by selecting Settings and then Administrative Tools from the Start menu.

Note:

The emctl utility described in Controlling the Management Service on UNIX is available in the bin subdirectory of the Oracle home where you installed the Management Agent; however, Oracle recommends that you use the Services control panel to start and stop the Management Agent on Windows systems.

Table 17-2 describes the Windows service that you use to control the Management Agent.

Table 17-2 Service Installed and Configured When You Install the Management Agent on Windows

Component Service Name Format Description

Oracle Management Agent

Oracle<agent_home>Agent

For example:

OracleOraHome1Agent

Use this to start and stop the Management Agent.


Note:

If you are having trouble starting or stopping the Management Agent on a Windows NT system, try stopping the Management Agent using the following emctl command:
$PROMPT> <AGENT_HOME>\bin\emctl istop agent

After stopping the Management Agent using the emctl istop agent command, start the Management Agent using the Services control panel.

This problem and solution applies only to the Windows NT platform, not to other Windows platforms, such as Windows 2000 or Windows XP systems.

Checking the Status of the Management Agent on Windows

To check the status of the Management Agent on Windows systems:

  1. Change directory to the following location in the AGENT_INSTANCE_HOME directory:

    AGENT_INSTANCE_HOME\bin
    
  2. Enter the following emctl command to check status of the Management Agent:

    $PROMPT> emctl status agent
    

    If the Management Agent is running, this command displays status information about the Management Agent, including the Agent Home, the process ID, and the time and date of the last successful upload to the Management Repository ().

Troubleshooting Management Agent Startup Errors

If the agent fails to start, see the emctl.log and emagent.nohup log files for details. Following are common issues and troubleshooting suggestions:

Management Agent starts up but is not ready

The Management Agent goes through the following process when it starts up:

  1. Starting up (the Management Agent has just received the request to start up and is going to start the initialization sequence)

  2. Initializing (the Management Agent is iterating over each of its components and is initializing them)

  3. Ready (All components have been initialized and the Management Agent is ready to accept requests)

The command to start the Management Agent (emctl start agent) has a default timeout of 120 seconds. At the end of that timeout, it will return control to the caller and will indicate what the last state of the Management Agent was when it returns control. Depending on the number of targets being monitored by the Management Agent, step 2 listed above could take a long time and it is possible that when the command exits, the state of the agent is "Initializing" and the command reports that the "agent is running but is not ready".

You can increase the timeout by setting an environment variable "EMAGENT_TIME_FOR_START_STOP". The value should indicate the number of seconds to wait before returning control to the caller.

Management Agent fails to start because of time zone mismatch between agent and OMS

The Management Agent uses the time zone set in emd.properties file. During the install process of the Management Agent, the agent and the host target are registered with the OMS along with the time zone. If the Management Agent's time zone is modified at any point after the installation, the OMS will signal the Management Agent to shut down as soon as it detects this mismatch.

To reset the Management Agent's time zone, run the following command:

emctl resettz agent

For more information about setting the time zone for the agent, see Changing the Management Agent Time Zone.

Agent fails to start due to possible port conflict

If the Management Agent cannot start and emctl reports that there is a possible port conflict, check the Management Agent's port (based on emd.properties:EMD_URL) and see if there is another application, such as another agent, running on the machine that is already bound to the port.

To resolve this issue, stop the application currently bound to the Management Agent's port.

Agent secure/unsecure fails

Securing or unsecuring of the Management Agent can fail if the password to secure the agent against the OMS is incorrect or if the OMS is locked or down. You can find the reason for the failure in the <agent state directory>/sysman/log/secure.log file.

Controlling the Oracle Management Service

When you start the Management Service, the following services are started:

  1. OPMN process. This is the watchdog for the Apache process. The OPMN process starts the Apache process if it crashes.

  2. Apache processes to start the HTTP server

  3. Node Manager Java process. This is the watchdog for the Managed Server and Admin Server processes. It restarts the Managed Server and Admin Server processes if they crash.

  4. Admin Server Java process (if the command to start OMS is executed on the first OMS machine). This is the WebLogic Server instance that maintains configuration data for configured Enterprise Manager domain.

  5. Managed Server Java process. This is the Managed WebLogic Server on which Enterprise Manager application is deployed.

  6. (On Windows only) Node Manager service process. This is the Windows service for starting and stopping the Node Manager (equivalent to the Node Manager process on Linux).

  7. (On Windows only) OMS service process. This is the Windows service for starting and stopping the OMS.

The following sections describe how to control the Oracle Management Service:

Controlling the Management Service on UNIX

To start, stop, or check the status of the Management Service with the Enterprise Manager command-line utility, follow these steps:

  1. Change directory to the ORACLE_HOME/bin directory in the Management Service home.

  2. Use the appropriate command described in Table 17-3.

    For example, to stop the Management Service, enter the following commands:

    $PROMPT> cd bin
    
    $PROMPT> ./emctl stop oms
    
    

Table 17-3 Starting, Stopping, and Checking the Status of the Management Service

Command Purpose

emctl start oms

Starts the Fusion Middleware components required to run the Management Service. Specifically, this command starts HTTP Server, the Node Manager, OPMN process, and the managed server on which the Management Service is deployed. In addition if this command is run on the host that has the Administration Server, the Administration Server is started too.

emctl stop oms

Stops the OMS managed server and HTTP server but leaves Node Manager and Administration Server running.

Note: The emctl stop oms command does not stop Fusion Middleware.

Use emctl stop oms -all to stop all processes including Administration Server, HTTP Server, Node Manager, and management server.

emctl status oms

Displays a message indicating whether or not the Management Service is running.

Run emctl status oms -details to view information about the configuration of the management service such as ports being used and the URLs for console and upload.


Controlling the Management Service on Windows

When you install the Oracle Management Service on a Windows system, the installation procedure creates three new services in the Services control panel.

The procedure for accessing the Services control panel varies, depending upon the version of Microsoft Windows you are using. For example, on Windows 2000, locate the Services control panel by selecting Settings, then Administrative Tools from the Start menu.

Note:

The emctl utility described in Controlling the Management Service on UNIX is available in the bin subdirectory of the Oracle home where you installed the Management Service; however, Oracle recommends that you use the Services control panel to start and stop the Management Service on Windows systems.

Table 17-4 describes the Windows services that you use to control the Oracle Management Service.

Table 17-4 Summary of Services Installed and Configured When Installing the Oracle Management Service on Windows

Component Service Name Format Description

WebLogic Server

OracleWeblogicNodeManager_EMGC_OMS1_1

Use this service to start and stop the node manager of the WebLogic Server that was installed and configured to deploy the Management Service J2EE application.

Oracle Management Server

OracleManagementServer_EMGC_OMS1_1

Use this service to start and stop all components that were installed and configured as part of the Management Service J2EE application.


Troubleshooting Oracle Management Service Startup Errors

Following are the log files you can check if the OMS fails to start:

Management Service Fails to Start

Check the logs located as indicated in Table 17-5. The INSTANCE_HOME mentioned in the table is the OMS instance home and n is the index of the OMS server.

Table 17-5 OMS Log Files Location

OMS Log File Log File Location

emctl log file

$INSTANCE_HOME/sysman/log/emctl.log file

Managed Server log files

$INSTANCE_HOME/user_projects/domains<DOMAIN_NAME>/servers/EMGC_OMS<n>/logs/EMGC_OMS<n>.log

$INSTANCE_HOME/user_projects/domains<DOMAIN_NAME>/servers/EMGC_OMS<n>/logs/EMGC_OMS<n>.out

OMS log files

$INSTANCE_HOME/sysman/log/emoms_pbs.log

$INSTANCE_HOME/sysman/log/emoms_pbs.trc

$INSTANCE_HOME/sysman/log/emoms.trc

$INSTANCE_HOME/sysman/log/emoms.log


WebTier Service Fails to Start

Check logs under <WebTier Instance Home>/diagnostics folder in case WebTier start fails.

Guidelines for Starting Multiple Enterprise Manager Components on a Single Host

Oracle Enterprise Manager components are used to manage a variety of Oracle software products. In most cases, in a production environment, you will want to distribute your database and WebLogic Server instances among multiple hosts to improve performance and availability of your software resources. However, in cases where you must install multiple WebLogic Servers or databases on the same host, consider the following guidelines.

When you start Fusion Middleware Control, the Management Agent, or Database Control, Enterprise Manager immediately begins gathering important monitoring data about the host and its managed targets. Keep this in mind when you develop a process for starting the components on the host.

Specifically, consider staggering the startup process so that each Enterprise Manager process has a chance to start before the next process begins its startup procedure. When you start up all the components (for example, after a restart of the system), use a process such as the following:

  1. Use the emctl start command to start Oracle Management Service.

  2. Wait 15 seconds.

  3. Use the emctl start agent command to start the Management Agent for the host.

Using a staggered startup procedure such as the preceding example will ensure that the processes are not in contention for resources during the CPU-intensive startup phase for each component.

Starting and Stopping Oracle Enterprise Manager 12c Cloud Control

As described in the previous sections, you use separate commands to control the Oracle Management Service and Management Agents.

The following sections describe how to stop and start all the Cloud Control components that are installed by the Oracle Enterprise Manager 12c Cloud Control Console installation procedure.

You can use this procedure to start all the framework components after a system reboot or to shutdown all the components before bringing the system down for system maintenance.

Starting Cloud Control and All Its Components

The following procedure summarizes the steps required to start all the components of the Cloud Control. For example, use this procedure if you have restarted the host computer and all the components of the Cloud Control have been installed on that host.

To start all the Cloud Control components on a host, use the following procedure:

  1. If your Oracle Management Repository resides on the host, change directory to the Oracle Home for the database where you installed the Management Repository and start the database and the Net Listener for the database:

    1. Set the ORACLE_HOME environment variable to the Management Repository database home directory.

    2. Set the ORACLE_SID environment variable to the Management Repository database SID (default is asdb).

    3. Start the Net Listener:

      $PROMPT> $ORACLE_HOME/bin/lsnrctl start
      
    4. Start the Management Repository database instance:

      ORACLE_HOME/bin/sqlplus /nolog
      
      SQL> connect SYS as SYSDBA
      
      SQL> startup
      
      SQL> quit
      
      

      See Also:

      Oracle Database Administrator's Guide for information about starting and stopping an Oracle Database.
  2. Start the Oracle Management Service:

    $PROMPT> OMS_HOME/bin/emctl start oms
    
  3. Change directory to the home directory for the Oracle Management Agent and start the Management Agent:

    $PROMPT> AGENT_HOME/bin/emctl start agent
    
    

    Note:

    Be sure to run the emctl start agent command in the Oracle Management Agent home directory and not in the Management Service home directory.

Stopping Cloud Control and All Its Components

The following procedure summarizes the steps required to stop all the components of the Cloud Control. For example, use this procedure if you have installed all the components of the Cloud Control on the same host you want to shut down or restart the host computer.

To stop all the Cloud Control components on a host, use the following procedure:

  1. Stop the Oracle Management Service:

    $PROMPT> $ORACLE_HOME/bin/emctl stop oms -all
    
  2. Change directory to the home directory for the Oracle Management Agent and stop the Management Agent:

    $PROMPT> AGENT_HOME/bin/emctl stop agent
    
    

    Note:

    Be sure to run the emctl stop agent command in the Oracle Management Agent home directory and not in the Oracle Management Service home directory.
  3. If your Oracle Management Repository resides on the same host, change directory to the Oracle Home for the database where you installed the Management Repository and stop the database and the Net Listener for the database:

    1. Set the ORACLE_HOME environment variable to the Management Repository database home directory.

    2. Set the ORACLE_SID environment variable to the Management Repository database SID (default is asdb).

    3. Stop the database instance:

      $PROMPT> ORACLE_HOME/bin/sqlplus /nolog
      
      SQL> connect SYS as SYSDBA
      
      SQL> shutdown
      
      SQL> quit
      
      

      See Also:

      Oracle Database Administrator's Guide for information about starting and stopping an Oracle Database.
    4. Stop the Net Listener:

      $PROMPT> $ORACLE_HOME/bin/lsnrctl stop
      
      

Additional Management Agent Commands

The following sections describe additional emctl commands you can use to control the Management Agent:

Uploading and Reloading Data to the Management Repository

Under normal circumstances, the Management Agent uploads information about your managed targets to the Management Service at regular intervals.

To use these commands, change directory to the AGENT_HOME/bin directory (UNIX) or the AGENT_HOME\bin directory (Windows) and enter the appropriate command as described in Table 17-6.

Table 17-6 Manually Reloading and Uploading Management Data

Command Description

emctl upload (agent)

Use this command to force an immediate upload of the current management data from the managed host to the Management Service. Use this command instead of waiting until the next scheduled upload of the data.

emctl reload (agent)

This command can be used to apply the changes after you have manually modified the emd.properties file. For example, to change the upload interval, emd.properties can be modified, and emctl reload can then be run.

Note: Oracle does not support manual editing of the targets.xml files unless the procedure is explicitly documented or you are instructed to do so by Oracle Support.


Specifying New Target Monitoring Credentials

To monitor the performance of your database targets, Enterprise Manager connects to your database using a database user name and password. This user name and password combination is referred to as the database monitoring credentials.

Note:

The instructions in this section are specific to the monitoring credentials for a database target, but you can use this procedure for any other target type that requires monitoring credentials. For example, you can use this procedure to specify new monitoring credentials for your Oracle Management Service and Management Repository.

When you first add an Oracle9i Database target, or when it is added for you during the installation of the Management Agent, Enterprise Manager uses the DBSNMP database user account and the default password for the DBSNMP account as the monitoring credentials.

When you install Oracle Database 11g, you specify the DBSNMP monitoring password during the database installation procedure.

As a result, if the password for the DBSNMP database user account is changed, you must modify the properties of the database target so that Enterprise Manager can continue to connect to the database and gather configuration and performance data.

Similarly, immediately after you add a new Oracle Database 11g target to the Cloud Control, you may need to configure the target so it recognizes the DBSNMP password that you defined during the database installation. Otherwise, the Database Home page may display no monitoring data and the status of the database may indicate that there is a metric collection error.

Note:

You can modify the Enterprise Manager monitoring credentials by using the Oracle Enterprise Manager 12c Cloud Control Console.

Listing the Targets on a Managed Host

There are times when you need to provide the name and type of a particular target you are managing. For example, you must know the target name and type when you are setting the monitoring credentials for a target.

To list the name and type of each target currently being monitored by a particular Management Agent:

  1. Change directory to the AGENT_HOME/bin directory (UNIX) or the AGENT_HOME\bin directory (Windows).

  2. Enter the following command to specify new monitoring credentials:

    $PROMPT>./emctl config agent listtargets
    
    
    

    shows the typical output of the command.

Example 17-2 Listing the Targets on a Managed Host

ade:[ exampname_1208_qc_ag ] [example_username@example emagent]$ emctl config agent listtargets
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
[example.us.oracle.com:11852, oracle_emd]
[example.us.oracle.com, host]
[chronos_test, oracle_webcache]
[chronos_apache_test, oracle_apache]
[mytestBeacon, oracle_beacon]
[CSAcollector, oracle_csa_collector]
[database, oracle_database]
[database2, oracle_database]
[database3, oracle_database]
[listener, oracle_listener]
[listener2, oracle_listener]
[listener3, oracle_listener]
[Management Services and Repository, oracle_emrep]
ade:[ example_username_1208_qc_ag ] [example_username@example emagent]$

Controlling Blackouts

Blackouts allow Enterprise Manager users to suspend management data collection activity on one or more managed targets. For example, administrators use blackouts to prevent data collection during scheduled maintenance or emergency operations.

You can control blackouts from the Oracle Enterprise Manager 12c Cloud Control Console or from the Enterprise Manager command line utility (emctl). However, if you are controlling target blackouts from the command line, you should not attempt to control the same blackouts from the Cloud Control Console. Similarly, if you are controlling target blackouts from the Cloud Control Console, do not attempt to control those blackouts from the command line.

See Also:

"Creating, Editing, and Viewing Blackouts" in the Enterprise Manager online help for information about controlling blackouts from the Cloud Control Console

From the command line, you can perform the following blackout functions:

  • Starting Immediate Blackouts

  • Stopping Immediate Blackouts

  • Checking the Status of Immediate Blackouts

    Note:

    When you start a blackout from the command line, any Enterprise Manager jobs scheduled to run against the blacked out targets will still run. If you use the Cloud Control Console to control blackouts, you can optionally prevent jobs from running against blacked out targets.

To use the Enterprise Manager command-line utility to control blackouts:

  1. Change directory to the AGENT_HOME/bin directory (UNIX) or the AGENT_INSTANCE_HOME\bin directory (Windows).

  2. Enter the appropriate command as described in Table 17-7.

    Note:

    When you start a blackout, you must identify the target or targets affected by the blackout. To obtain the correct target name and target type for a target, see Listing the Targets on a Managed Host.

Table 17-7 Summary of Blackout Commands

Blackout Action Command

Set an immediate blackout on a particular target or list of targets

emctl start blackout <Blackoutname> [<Target_name>[:<Target_Type>]].... [-d <Duration>]

Be sure to use a unique name for the blackout so you can refer to it later when you want to stop or check the status of the blackout.

The -d option is used to specify the duration of the blackout. Duration is specified in [days] hh:mm where:

  • days indicates number of days, which is optional

  • hh indicates number of hours

  • mm indicates number of minutes

If you do not specify a target or list of targets, Enterprise Manager will blackout the local host target. All monitored targets on the host are not blacked out unless a list is specified or you use the -nodelevel argument.

If two targets of different target types share the same name, you must identify the target with its target type.

Stop an immediate blackout

emctl stop blackout <Blackoutname>

Set an immediate blackout for all targets on a host

emctl start blackout <Blackoutname> [-nodeLevel] [-d <Duration>]

The -nodeLevel option is used to specify a blackout for all the targets on the host; in other words, all the targets that the Management Agent is monitoring, including the Management Agent host itself. The -nodeLevel option must follow the blackout name. If you specify any targets after the -nodeLevel option, the list is ignored.

Check the status of a blackout

emctl status blackout [<Target_name>[:<Target_Type>]]....


Use the following examples to learn more about controlling blackouts from the Enterprise Manager command line:

  • To start a blackout called "bk1" for databases "db1" and "db2," and for Oracle Listener "ldb2," enter the following command:

    $PROMPT> emctl start blackout bk1 db1 db2 ldb2:oracle_listener -d 5 02:30
    

    The blackout starts immediately and will last for 5 days 2 hours and 30 minutes.

  • To check the status of all the blackouts on a managed host:

    $PROMPT> emctl status blackout
    
  • To stop blackout "bk2" immediately:

    $PROMPT> emctl stop blackout bk2
    
  • To start an immediate blackout called "bk3" for all targets on the host:

    $PROMPT> emctl start blackout bk3 -nodeLevel
    
  • To start an immediate blackout called "bk3" for database "db1" for 30 minutes:

    $PROMPT> emctl start blackout bk3 db1 -d 30
    
  • To start an immediate blackout called "bk3" for database "db2" for five hours:

    $PROMPT> emctl start blackout bk db2 -d 5:00
    
    

Changing the Management Agent Time Zone

The Management Agent may fail to start after the upgrade if it realizes that it is no longer in the same time zone that it was originally configured with.

You can reset the time zone used by the Management Agent using the following command:

emctl resetTZ agent

This command will correct the Management Agent side time zone and specify an additional command to be run against the Management Repository to correct the value there.

IMPORTANT:

Before you change the Management Agent time zone, first check to see if there are any blackouts that are currently running or scheduled to run on any target managed by that Management Agent.

To check for blackouts:

  1. From the Cloud Control home page, click Targets and then All Targets. In the All Targets page, locate the Management Agent in the list of targets. Click on the Management Agent's name. This brings you to the Management Agent's home page.

  2. The list of targets monitored by the Management Agent are listed in the Monitored Targets section.

  3. For each of target in the list:

    1. Click the target name. This brings you to the target's home page.

    2. From the <Target> menu, select Monitoring and then click Blackouts. This allows you to check any currently running blackouts or blackouts that are scheduled in the future for this target.

If such blackouts exist, then:

  1. From the Cloud Control Console, stop all currently running blackouts on all targets monitored by that Management Agent.

  2. Stop all scheduled blackouts on all targets monitored by that Management Agent.

Once you have stopped all currently running and scheduled blackouts, you can run the emctl resetTZ agent command to change the Management Agent's time zone.Once you have changed the Management Agent's time zone, create new blackouts on the targets as needed.

Reevaluating Metric Collections

Use the following command to perform an immediate reevaluation of a metric collection:

emctl control agent runCollection <targetName>:<targetType> <colletionItemName>

where <collectionItemName> is the name of the Collection Item that collects the metric.

Performing this command causes the reevaluated value of the metric to be uploaded into the Management Repository, and possibly trigger alerts if the metric crosses its threshold.

Related metrics are typically collected together; collectively a set of metrics collected together is called a Metric Collection. Each Metric Collection has its own name. If you want to reevaluate a metric, you first need to determine the name of the Metric Collection to which it belongs, then the CollectionItem for that Metric Collection.

When you run the previous command to reevaluate the metric, all other metrics that are part of the same Metric Collection and Collection Item will also be reevaluated.

Perform the following steps to determine the Metric Collection name and Collection Item name for a metric:

  1. Go to $INSTALL_BASE/ngagent/plugins directory, where $INSTALL_BASE is the root of the installation. The Oracle Home of the Management Agent exists in this directory.

  2. Locate the XML file for the target type. For example, if you are interested in the host metric 'Filesystem Space Available(%)' metric, look for the host.xml file.

  3. In the xml file, look for the metric in which you are interested. The metric that you are familiar with is actually the display name of the metric. The metric name would be preceded by a tag that started with:

    <Label NLSID=

    For example, in the host.xml file, the metric 'Filesystem Space Available(%)" would have an entry that looks like this:

    <Label NLSID="host_filesys_pctAvailable">Filesystem Space Available (%) </Label>
    
  4. Once you have located the metric in the xml file, you will notice that its entry is part of a bigger entry that starts with:

    <Metric NAME=

    Take note of the value defined for "Metric NAME". This is the Metric Collection name. For example, for the 'Filesystem Space Available(%)' metric, the entry would look like this:

    <Metric NAME="Filesystems"

    So for the 'Filesystem Space Available(%)' metric, the Metric Collection name is 'Filesystems'.

  5. The Collection Item name for this Metric Collection needs to be determined next. Go to the $INSTALL_BASE/ngagent/plugins/default_collection directory, where $INSTALL_BASE is the Oracle Home of the Management Agent.

  6. In this directory, look for the collection file for the target type. In our example, this would be host.xml.

  7. In cases where a Metric Collection is collected by itself, there would be a single Collection Item of the same name in the collection file. To determine if this is the case for your Metric Collection, look for an entry in the collection file that starts with:

    <CollectionItem NAME=

    where the value assigned to the CollectionItem NAME matches the Metric NAME in step (4).

    For the 'Filesystem Space Available(%)' metric, the entry in the collection file would look like:

    <CollectionItem NAME = "Filesystems"

  8. If you find such an entry, then the value assigned to "CollectionItem NAME" is the collection item name that you can use in the emctl command.

  9. Otherwise, this means the Metric Collection is collected with other Metric Collections under a single Collection Item. To find the Collection Item for your Metric Collection, first search for your Metric Collection. It should be preceded by the tag:

    <MetricColl NAME=

    Once you have located it, look in the file above it for: <CollectionItem NAME=

    The value associated with the CollectionItem NAME is the name of the collection item that you should use in the emctl command.

    For example if the you want to reevaluate the host metric "Open Ports", using the previous steps, you would do the following:

    1. Go to the $INSTALL_BASE/ngagent/plugins directory where $INSTALL_BASE is the Oracle Home of the Management Agent. Look for the host.xml file and in that file locate: <Metric NAME="openPorts".

    2. Then go to the $INSTALL_BASE/ngagent/plugins/default_collection directory. Look for the host.xml file and in that file look for <CollectionItem NAME="openPorts".

      Failing this, look for <MetricColl NAME="openPorts".

    3. Look above this entry in the file to find the <CollectionItem NAME= string and find <CollectionItem NAME="oracle_security".

    The CollectionItem NAME oracle_security is what you would use in the emctl command to reevaluate the Open Ports metric.

emctl Commands

This section lists the emctl commands for the Enterprise Manager Management Agent and Oracle Management Service.

Table 17-8 explains the emctl commands for OMS.

Table 17-8 emctl Commands for OMS

emctl Command Description

emctl [getversion] oms

Gets the version of the Management Service. Sample output is as follows:

./emctl getversion oms
Oracle Enterprise Manager Cloud Control 12c Release 12.1.0.1.0  
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
Enterprise Manager 12c OMS Version 12.1.0.1.0

emctl [start] oms

Starts the Management Service.

emctl stop oms -all

Stops the Management Service including Administration Server, HTTP Server, Node Manager, and management server.

emctl stop oms -all -force and emctl stop oms -force

-force can be used with both emctl stop oms -all and emctl stop oms.

If the emctl stop oms commands do not shutdown the relevant processes, using -force option will forcefully stop the relevant processes.

emctl status oms

Lists the status of the Management Service

emctl status oms -details

Lists Management Service details such as port numbers, lock status, domain information, and so on.

emctl config oms -list_repos_details

Lists the Management Service repository details.

emctl config oms -store_repos_details [-repos_host <host> -repos_port <port> -repos_sid <sid> | -repos_conndesc <connect descriptor> ] -repos_user <username> [-repos_pwd <pwd>]

Configures the settings used by Management Service to connect to the Management Repository.

emctl config oms -change_repos_pwd [-old_pwd <old_pwd>] [-new_pwd <new_pwd>] [-use_sys_pwd [-sys_pwd <sys_pwd>]]

Configures the password used by Management Service to connect to the Management schema in the Management Repository.

emctl config oms -change_view_user_pwd [-sysman_pwd <sysman_pwd>] [-user_pwd <user_pwd>] [-auto_generate]

Configures the password used by Management Service for MGMT_VIEW user that is used for report generation.

emctl upload

Uploads xml files that are pending to upload to the OMS under the upload directory.


Table 17-9 explains emctl commands for Management Agents.

Table 17-9 emctl Commands for Management Agent

emctl Command Description

emctl start | stop agent

Starts or stops Management Agent.

emctl status agent

Lists the status of Management Agent.

emctl status agent -secure

Lists the secure status of the agent and the port on which the agent is running in secure mode and also the OMS security status of the agent it points to. This command also gives the OMS secure port. Below is an example output:

bash-3.00$ emctl status agent -secure
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

Checking the security status of the Agent at location set in /ade/example_username_cpap4_ag/oracle/sysman/config/emd.properties...  Done.

Agent is secure at HTTPS Port 1838.

Checking the security status of the OMS at http://example.us.oracle.com:7654/em/upload/...  Done.

OMS is secure on HTTPS Port 4473

bash-3.00$ 

emctl status agent scheduler

Lists all Running, Ready, and Scheduled Collection threads.

emctl status agent jobs

Lists the status of the jobs that are running at present on the agent. The following is an example output:

bash-3.00$ emctl status agent jobs
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

-------------------------------------------------

  step id  typ     pid  stat  command line

  -------  ---     ---  ----  ------------

-------------------------------------------------

Agent is Running and Ready

emctl status agent target <target name>,<target type>,<metric>

Lists the detailed status of the specified targets in the order of target name, target type. The following is an example of an oracle_database target. You can also provide a particular metric name in the emctl command to get the status of a particular metric of a target.

bash-3.00$ emctl status agent target database,oracle_database
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

-------------------------------------------------

Target Name : database

Target Type : oracle_database

Current severity state

----------------------

Metric        Column name      Key    State   Timestamp          

-------------------------------------------------
DeferredTrans errortrans_count  n/a CLEAR 2011-07-09 02:38:07
DeferredTrans deftrans_count    n/a   CLEAR 2011-07-09 02:38:07
ha_recovery missing_media_files n/a   CLEAR 2011-07-09 02:28:57
ha_recovery corrupt_data_blocks n/a  CLEAR 2011-07-09 02:28:57
ha_recovery datafiles_need_recovery n/a CLEAR 2011-07-09 02:28:57
Response     Status        n/a     CLEAR  2011-07-09 02:38:04
Response userLogon         n/a CLEAR  2011-07-09 02:38:04
Response    State          n/a  CLEAR  2011-07-09 02:38:04
OCMInstrumentation  NeedToInstrument n/a CLEAR 2011-07-09 02:31:55
health_check  Status  n/a  CLEAR   2011-07-09 02:40:00
health_check  Unmounted  n/a  CLEAR  2011-07-09 02:40:00
health_check   Mounted  n/a CLEAR  2011-07-09 02:40:00
health_check Unavailable  n/a  CLEAR  2011-07-09 02:40:00
health_check Maintenance n/a  CLEAR  2011-07-09 02:40:00
sql_response       time  n/a  CLEAR  2011-07-09 02:38:50
sga_pool_wastage java_free_pct n/a  CLEAR  2011-07-09 02:28:

58
UserAudit username DBSNMP_example  CLEAR 2011-07-09 02:32:48

-------------------------------------------------------

Agent is Running and Ready

emctl status agent mcache <target name>,<target type>,<metric>

Lists the names of the metrics for which the values are present in the metric cache. See the following example for a simple host target:

bash-3.00$ emctl status agent mcache example.us.oracle.com,host
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

-------------------------------------------------------
Metric cache contains value for following metrics at 2011-07-09 02:54:47

CPUUsage

DiskActivity

FileMonitoring

LPAR Performance on AIX

Load

Network

PagingActivity

-------------------------------------------------------

Agent is Running and Ready

 

The metrics listed above are the ones whose values are present in the metric cache.

emctl reload agent dynamicproperties [<Target_name>:<Target_Type>]...

Recomputes the dynamic properties of a target and generates the dynamic properties for the target.Sample output for oracle_database is as follows:

bash-3.00$ emctl reload agent dynamicproperties database:oracle_database
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

-------------------------------------------------------

EMD recompute dynprops completed successfully

emctl pingOMS [agent]

Pings the OMS to check if the agent is able to connect to the OMS. Agent will wait for the reverse ping from the OMS so that agent can say the pingOMS is successful.

emctl config agent getTZ

Gets the current timezone set in the environment.

emctl config agent getSupportedTZ

Prints the supported timezone based on the setting in the environment.

emctl config console <fileloc> [<EM loc>]

Allows you to configure the console based on the configuration entries that you have mentioned in the file <fileloc>.

<EM loc> is optional and can be used to operate on a different Oracle Home.

emctl config [agent] listtargets [<EM loc>]

Lists all targets present in targets.xml.

<EM loc> is optional and can be used to operate on a different Oracle Home.

emctl control agent runCollection <target_name>:<target_type> <metric_name>

Allows to manually run the collections for a particular metric of a target. Sample output is as follows:

emctl control agent runCollection example.us.oracle.com:host CPUUsage
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.

-------------------------------------------------------

EMD runCollection completed successfully

emctl resetTZ agent

Resets the timezone of the agent. Stop the agent first and then run this command to change the current timezone to a different timezone. Then start the agent.

emctl getversion agent

Prints the version of the agent. Sample output is as follows:

./emctl getversion agent
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
Oracle Enterprise Manager 12c Release 1 Cloud Control Agent 12.1.0.1.0

emctl dumpstate agent <component> . . .

Generates the dumps for the agent. This command allow you to analyze the memory/cpu issues of the agent. Sample output is as follows:

./emctl dumpstate agent
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
Dumpstate succeeded

emctl gensudoprops

Generates the sudo properties of the agent.

emctl clearsudoprops

Clears the sudo properties.

emctl clearstate

Clears the state directory contents. The files that are located under $ORACLE_HOME/sysman/emd/state will be deleted if this command is run. The state files are the files which are ready for the agent to convert them into corresponding xml files.

emctl getemhome

Prints the agent home directory. The sample output is as follows:

bash-3.00$ emctl getemhome
Oracle Enterprise Manager 12c Release 1 Cloud Control 12.1.0.1.0. 
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
EMHOME=/scratch/aime/gcagent/ngagent/agent_inst

emctl start blackout <Blackoutname> [-nodeLevel] [<Target_name>[:<Target_Type>]].... [-d <Duration>]

Starts blackout on a target.

<Target_name:Target_type> defaults to local node target if not specified.If -nodeLevel is specified after <Blackoutname>,the blackout will be applied to all targets and any target list that follows will be ignored.Duration is specified in [days] hh:mm

emctl stop blackout <Blackoutname>

Stops the blackout that was started on a particular target. Only those blackouts that are started by the emctl tool can be stopped using emctl. This command cannot stop the blackouts that are started using the Console or emcli.

emctl status blackout [<Target_name>[:<Target_Type>]]....

Provides the status of the blackout of the target. The status includes the type of blackout, whether one time, repeating, or a scheduled blackout. This command also specifies whether the blackout has started or stopped.

emctl secure agent [registration password]

Secures the agent against an OMS. The registration password must be provided.

emctl unsecure agent

Unsecures the agent. This will make the agent unsecure and the agent's port will be changed to http port.

emctl verifykey

Verifies the communication between the OMS and agent by sending pingOMS.

emctl deploy agent [-s <install-password>] [-o <omshostname:consoleSrvPort>] [-S] <deploy-dir> <deploy-hostname>:<port> <source-hostname>

'agent' creates and deploys only the agent.

[-s <password>]: Install password for securing agent.

[-S ]: Password will be provided in STDIN.

[-o <omshostname:consoleSrvPort>]: The OMS Hostname and console servlet port. Choose the unsecured port.

<deploy-dir> : Directory to create the shared (state-only) installation port.

<deploy-hostname:port> : Host name and port of the shared (state-only) installation. Choose unused port.

<source-hostname>: The host name of the source install. Typically the machine where EM is installed. This is searched and replaced in targets.xml by the host name provided in argument <deploy-hostname:port>.

<sid>: The instance of the remote database. Only specified when deploying "dbconsole".


Using emctl.log File

The emctl.log file is a file that captures the results of all emctl commands you run. For Management Agent, the log file resides in the $AGENT_INSTANCE_HOME/sysman/log directory of the Management Agent, and for Management Service, the log file resides in the $OMS_INSTANCE_HOME/sysman/log directory. The file is updated every time you run an emctl command. If your emctl command fails for some reason, access this log file to diagnose the issue.

For example, run the following command from the Oracle home directory of the Management Agent to check its status:

<agent_home>emctl status agent

After running the command, navigate to the log directory to view the following information in the emctl.log file:

1114306 :: Wed Jun 10 02:29:36 2011::AgentLifeCycle.pm: Processing status agent
1114306 :: Wed Jun 10 02:29:36 2011::AgentStatus.pm:Processing status agent
1114306 :: Wed Jun 10 02:29:37 2011::AgentStatus.pm:emdctl status returned 3

Here, the first column, that is, 1114306, is the PID that was used to check the status. The second column shows the date and time when the command was run. The third column mentions the Perl script that was run for the command. The last column describes the result of the command, where it shows the progress made by the command and the exit code returned for the command. In this case, the exit code is 3, which means that the Management Agent is up and running.

Similarly, for the Management Service, you can run the following command from the Oracle home directory of the Management Service to check its status:

<agent_home>emctl status oms

In another example, run the following command from the Oracle home directory of the Management Agent to upload data:

<agent_home>emctl upload agent


After running the command, navigate to the log directory to view the following information in the emctl.log file:

1286220 :: Tue Jun  9 07:13:09 2011::AgentStatus.pm:Processing upload
1286220 :: Tue Jun  9 07:13:10 2011::AgentStatus.pm:emdctl status agent returned 3
1286220 :: Tue Jun  9 07:13:41 2011::AgentStatus.pm: emdctl upload returned with exit code 6

Here, the entries are similar to the entries in the first example, but the exit code returned is 6, which means the upload operation is failing for some reason.

The exit codes returned depend on the emctl command executed. In general, exit code of zero means success and any exit code other than zero means failure. For details about the cause of failure, view the error message.

For more information about Management Agent and Oracle Management Service log files, see Chapter 18.