Monitoring Java EE Components

Monitoring Alerts (Command Line)

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.


Note –

The commands are shown on multiple lines for readability. You must enter the commands on a single line.


Listing the Available Methods For the Alert Service

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

Listing the Query Fields

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

Viewing Alerts

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.

Changing the Status of 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).

Deleting Alerts

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.