The Enterprise Manager command-line client enables you to monitor application servers, Collaborations, and alerts.
The Enterprise Manager command-line client is located in the JavaCAPS-install-dir/emanager/em-client directory.
The Enterprise Manager command-line client provides two monitoring services:
The runtime service enables you to monitor application servers and Collaborations.
The alert service enables you to monitor alerts.
The computer on which you run the command-line client must have Java 1.4.2 or later installed. In addition, the path variable must include an entry for the Java installation’s bin directory.
Do not include quotation marks in the value of the JAVA_HOME variable.
If you are running UNIX, then use the em-cmdline-client.sh script.
If you are running Windows, then use the em-cmdline-client.bat script.
The syntax of the Enterprise Manager command-line client is:
em-cmdline-client -l hostname -p port -u username -w password -s service -m method -Pparameter=value |
The following table describes the arguments.
Table 1–6 Enterprise Manager Command-Line Client Arguments
Argument |
Description |
---|---|
-h, --help |
Displays help about the command-line client. |
-l, --host |
Enables you to specify the hostname of the computer where Enterprise Manager is running. |
-p, --port |
Enables you to specify the base port number of Enterprise Manager. |
-u, --userid |
Enables you to specify an Enterprise Manager user name. |
-w, --password |
Enables you to specify the password for the Enterprise Manager user name. |
-s, --service |
Enables you to specify the service that you want to use. The runtime service is called RuntimeService51x. The alert service is called AlertService51x. |
-m, --method |
Enables you to specify the method that you want to call. |
-P |
Enables you to specify a parameter name and value for a method. Some methods do not require parameters. |
-n, --signatures |
Displays the signatures of the available methods. |
-t, --timeout |
Enables you to specify an HTTP request timeout value for the command (in milliseconds). |
-v, --validate |
Checks for the required number of parameters. |
You use the following arguments to connect to the Enterprise Manager server: -l, -p, -u, and -w.
You can monitor application servers and Collaborations by using the runtime service of the Enterprise Manager command-line client.
Before you begin, ensure that the Enterprise Manager server is running.
Set the -s argument to RuntimeService51x. Set the -m argument to the desired method. For each parameter, set the -P argument to the name and value.
The commands are shown on multiple lines for readability. You must enter the commands on a single line.
You can display a list of the available methods for the runtime service by using the -n argument. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -n Note: the order of the parameters is important. Available methods and parameters: -m getState -Pcomponent=<component> -PcomponentType=<componentType> -m startComponent -Pcomponent=<component> -PcomponentType=<componentType> -m getComponentsList -m stopComponent -Pcomponent=<component> -PcomponentType=<componentType> -m getStatus -Pcomponent=<component> -PcomponentType=<componentType> |
The methods of the runtime service require you to specify the component path and component type. The getComponentsList method enables you to obtain this information. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -m getComponentsList e51x|Servers|myserver:4848 is51x e51x|Servers|myserver:4848|IQ_Manager_18007 stcms e51x|Servers|myserver:4848|Sun_JMQ_7676 jmq e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1 jce.JavaCollaborationDefinition e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service2 jce.JavaCollaborationDefinition e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Topic1 messageService.Topic |
The getState method enables you to display the current state of an application server or Collaboration, as well as a JMS IQ Manager. You must specify the following parameters: the component path and the component type. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -m getState -Pcomponent="e51x|Servers|myserver:4848" -PcomponentType=is51x Up |
The getStatus method enables you to view basic information for an application server or Collaboration. You must specify the following parameters: the component path and the component type. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -m getStatus -Pcomponent="e51x|Servers|myserver:4848" -PcomponentType=is51x HostAndPort = myserver:4848 Component = e51x|Servers|myserver:4848 System = e51x RestartRequired = true |
The startComponent method enables you to start a Collaboration. You must specify the following parameters: the component path and the component type. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -m startComponent -Pcomponent="e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1" -PcomponentType=jce.JavaCollaborationDefinition |
The stopComponent method enables you to stop an application server domain, an application server instance, or a Collaboration. You must specify the following parameters: the component path and the component type. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s RuntimeService51x -m stopComponent -Pcomponent="e51x|Servers|myserver:4848|Project1|Deployment1|CMap1|Service1" -PcomponentType=jce.JavaCollaborationDefinition |
You cannot stop a message server with the stopComponent method.
The command line does not provide feedback to indicate that the method succeeded. However, you can verify whether the component is up or down by using the getState method.
You can monitor alerts by using the alert service of the Enterprise Manager command-line client.
Before you begin, ensure that the Enterprise Manager server is running.
Set the -s argument to AlertService51x. Set the -m argument to the desired method.
The commands are shown on multiple lines for readability. You must enter the commands on a single line.
You can display a list of the available methods for the alert service by using the -n argument. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -n Note: the order of the parameters is important. Available methods and parameters: -m deleteAlerts -Pfilter=<filter> -m getAllAlerts -m observeAlerts -Pfilter=<filter> -m resolveAlerts -Pfilter=<filter> -m resolveAllAlerts -m deleteAllAlerts -m observeAllAlerts -m getAlertQueryFields -m getAlerts -Pfilter=<filter> -m resetAlerts -Pfilter=<filter> -m resetAllAlerts |
The getAlertQueryFields method enables you to list the filters that you can use for the other methods. For example:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m getAlertQueryFields from to id environmentName physicalHostName logicalHostName serverName componentProjectPathName deploymentName componentName severity type observationalState operationalState messageCode details |
The getAlerts method enables you to display all of the alerts for the specified components. You can display a subset of the alerts by including one or more filters. The following example specifies two filters:
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m getAlerts -Pfilter=componentProjectPathName=Project1;environmentName=Environment1 ID:10 Date:Wed Jun 04 15:56:58 PDT 2008 EnvironmentName:Environment1 LogicalHostName:LogicalHost1 ServerName:server ComponentProjectPathName:Project1 DeploymentName:Deployment1 ComponentName:Service1 PhysicalHostName:myserver:4848 Severity:INFO Type:COLLABORATION ObservationalState:Unobserved OperationalState:Running MessageCode:COL-00001 Details: Collaboration jcdB is RUNNING ID:9 Date:Wed Jun 04 15:56:57 PDT 2008 EnvironmentName:Environment1 LogicalHostName:LogicalHost1 ServerName:server ComponentProjectPathName:Project1 DeploymentName:Deployment1 ComponentName:Service1 PhysicalHostName:myserver:4848 Severity:INFO Type:COLLABORATION ObservationalState:Unobserved OperationalState:Running MessageCode:COL-00001 Details: Collaboration jcdA is RUNNING |
The getAllAlerts method enables you to display all of the alerts.
The initial status of an alert is Unobserved. You can change the status to Observed or Resolved. Observed means that you looked at and acknowledged the alert. Resolved means that you fixed the problem that caused the alert.
The observeAlerts method enables you to change the status of an alert to Observed.
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m observeAlerts -Pfilter=componentProjectPathName=Project1;environmentName=Environment1 |
The observeAllAlerts method enables you to change the status of all alerts to Observed.
The resolveAlerts method enables you to change the status of an alert to Resolved.
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m resolveAlerts -Pfilter=componentProjectPathName=Project1;environmentName=Environment1 |
The resolveAllAlerts method enables you to change the status of all alerts to Resolved.
The resetAlerts method enables you to change the status of an alert to the initial value (Unobserved).
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m resetAlerts -Pfilter=componentProjectPathName=Project1;environmentName=Environment1 |
The resetAllAlerts method enables you to change the status of all alerts to the initial value (Unobserved).
The deleteAlerts method enables you to delete alerts.
em-cmdline-client -l entmgrhost -p 15000 -u Administrator -w STC -s AlertService51x -m deleteAlerts -Pfilter=componentProjectPathName=Project1;environmentName=Environment1 |
The deleteAllAlerts method enables you to delete all alerts.