# WLOC Administration Console Online Help

# Define actions

Before you begin

Review Define and assign policies.

You enforce policy constraints by defining actions that occur when services operate outside of policy constraints.

To define an action:

1. Access the Actions page in one of the following ways:
   - Click the Policies tab in the WLOC navigation bar, click the Definitions tab, and click the Actions tab.
   - Click the Home tab in the WLOC navigation bar and click Actions under Manage Policies.

   The list of currently defined actions is displayed in the Actions table.

2. Click Add Action on the Actions page.
3. Modify the fields for the action, as required:

   Field | Description
   --- | ---
   Name | Name of the action. The action name cannot be modified once it is set.
   Description | Description of the action. This field is optional.
   Approval | Flag that specifies whether the action requires approval. See Approve or deny actions.
   Type | Type of action that you want to add. See "Action Types" below.

   Action Types

   The following sections summarize the types of actions that can be defined. Depending on the action type that you choose, you may be required to provide additional configuration information. For example, for all Control action types, no additional configuration is required. For all Notification or Resource action types, however, you must provide additional configuraiton information.

   Each action that you define applies to a specific scope, as indicated in each table: global (system), service, or process group. You do not explicitly specify the scope when adding actions. However, you should be careful to match constraints and actions that share the same scope. See Define constraints for information about the actions that are valid for each type of constraint. For a summary of contraints and actions by scope, see Defining Policies.

   Note: Notification actions can be matched with any type of constraint.

   Control Action Types (Service or Process Group Scope)

   Control action types enable you to manage a service or instance of a Java process. Control action types have a service or process group scope, depending on the component being acted on (that is, service or instance of a JVM process), as defined in the following table.

   Select one of the following Control action types from the Type drop-down list.

   Action Type | Description | Scope
   --- | --- | ---
   StartServiceAction | Start a service. | Service
   StopServiceAction | Stop a service. When modifying this action type, you can set the `GracefulShutdown` flag to specify whether the shutdown of instances is graceful. To disable a graceful shutdown, enter `GracefulShutdown=false` in the property text box when modifying the action type.By default, `GracefulShutdown` is set to `true`. When `GracefulShutdown` is enabled, WebLogic Server instances will continue to run until inflight work has completed. The amount of time it takes to shut down an instance depends on how long it takes the inflight work to complete. WLOC does not consider the StopServiceAction to be complete until all the processes in the service have exited. You can monitor the progress of the instances being shutdown by looking at the log files of the WebLogic Server endpoint. If you are not concerned with the completion of inflight work, you can disable `GracefulShutdown` so that instances perform a hard shutdown. For information about modifying the action type, see Modify actions. | Service
   TestStartServiceAction | Test to verify that a service will start. | Service
   StageServiceAction | Create and stage an LVM instance on an ESX Agent. | Service
   DestroyServiceAction | Destroy a service. | Service
   StartJavaInstanceAction | Start an instance of a Java process. | Process group
   StopJavaInstanceAction | Stop an instance of a Java process. | Process group
   DestroyJavaInstanceAction | Destroy an instance of a Java process. | Process group
   StageJavaInstanceAction | Create an instance of a Java process. | Process group
   RemoteAction | Gracefully stop an instance of a Java process. When editing a RemoteAction, you can specify the following properties in the properties field: `class=name`: Proxy class to be used for executing this remote shutdown action. This property defaults to `WLShutdownProxy`. `args=args`: Comma-separated list of proxy class arguments. | Process group
   ResumeJavaInstanceAction | Resume an instance of a Java process. | Process group
   SuspendJavaInstanceAction | Suspend an instance of a Java process. | Process group
   JavaInstanceConfigAction | Change the configuration for an instance of a Java process. | Process group

   Notification Action Types (Global Scope)

   Notification action types enable you to send notifications to various consumers. All notification action types have a global scope. You configure the default values for each notification action type when configuring the Controller, as described in Configure notification defaults.

   Select one of the following Notification action types from the Type drop-down list and click Next to configure the additional fields.

   Action Type | Description | Additional Fields
   --- | --- | ---
   Console | Send a notification to the WLOC Administration Console. You can send a message to the WLOC Events page, and modify the appearance of the managed object by changing its color and tagging it with an icon. | Send Event Viewer Message: Flag that specifies whether to send a message to the WLOC Events page (and Tasks and Events viewer) when the action is triggered. See Monitor events. Message: Message that is sent to the WLOC event viewer (if you enabled the Send Event Viewer Message flag). Change Managed Object Color: Flag that specifies whether to change the color of the managed object in the WLOC Administration Console when the action is triggered. Managed Object Name: Name of the Agent, resource pool, service, or process whose color you want to change (if you enabled the Change Managed Object Color flag). Color: Color to which you want the managed object changed (if you enabled the Change Managed Object Color flag). Select CUSTOM to specify a custom color. Valid options include: Red, Orange, Yellow, Green, Blue, Indigo, Violet, and CUSTOM. Custom Color: Custom color to which you want the manage object changed (if you enabled the Change Managed Object Color flag). Change Managed Object Icon: Flag that specifies whether you want to tag the managed object with an icon when the action is triggered. Icon: Icon that is used to tag the managed object (if you enabled the Change Managed Object Icon flag). Valid icons include: Ok, Warning, and Error.
   EmailNotificationAction | Send a notification to a set of email addresses using the Simple Mail Transfer Protocol (SMTP). | Notification Subject: Information that appears in the subject line of the email. Notification Message: Text of the message. To Address: Comma-separated list of email addresses to which the message is sent. For example, `somebody@somecompany.com.` From Address: Email address from which the message is sent. For example, `somebody@somecompany.com.` SMTP Server: Address of the SMTP server. For example, `smtpserver.somecompany.com.`
   JMXNotificationAction | Send a Java Management Extensions (JMX) notification (`javax.management.Notification`). | Notification Subject: Information that appears in the subject line of the message. Notification Message: Text of the message.
   JMSNotificationAction | Send a notification to a Java Message Service (JMS) destination (topic or queue). | Notification Subject: Information that appears in the subject line of the message. Notification Message: Text of the message. Destination JNDI Name: JNDI name of the JMS destination. For example, `com.bea.adaptive.loc.notification.JMSNotifier.` Connection Factory JNDI Name: JNDI name of the JMS connection factory. For example, `QueueConnectionFactory`. The default for WebLogic Server is: `com.bea.adaptive.loc.agent.process.configuration.internal.WLSConfigurationUpdateConnectionFactoryImpl` JNDI Initial Factory: JNDI initial factory. For example, `org.mom4j.jndi.InitialCtxFactory`. The default for WebLogic Server is: `weblogic.jndi.WLInitialContextFactory` JNDI Provider URL: URL of the JNDI provider. For example `xcp://somehost:9911`. The default for WebLogic Server is: `/jndi/weblogic.management.mbeansservers.edit.` JNDI Security Principal: User name used for authenticating with the JNDI provider. Password: Password used for authenticating with the JNDI provider.
   SNMPNotificationAction | Send a notification as a Simple Network Management Protocol (SNMP) trap. | Notification Subject: Information that appears in the subject line of the message. Notification Message: Text of the message.

   Resource Action Types (Process Group Scope)

   Resource action types enable you to manage the resources in your environment. All resource action types have a process group scope. Select one of the following Resource action types from the Type drop-down list and click Next to configure the additional fields.

   Action Type | Description | Additional Fields
   --- | --- | ---
   ChangeMaxCPUAction | Change the maximum amount of CPU available. | Class: Name of the action class. Properties: Enter one of the following properties to update the maximum CPU capacity: `Change To=value`: Value to which you want to change the CPU capacity. `Change For=value`: Value to increment or decrement the CPU capacity.
   ChangeMinCPUAction | Change the minimum amount of CPU available. | Class: Name of the action class. Properties: Enter one of the following properties to update the miminum CPU capacity: `Change To=value`: Value to which you want to change the CPU capacity. `Change For=value`: Value to increment or decrement the CPU capacity.
   ChangeShareCPUAction | Change the share of the CPU available. The higher the value, the more CPU share the resource will receive. | Class: Name of the action class. Properties: Enter one of the following properties to update the CPU share: `Change To=value`: Value to which you want to change the CPU share. `Change For=value`: Value to increment or decrement the CPU share.
   ChangeMaxMemoryAction | Change the maximum amount of memory that is available. | Class: Name of the action class. Properties: Enter one of the following properties to update the maximum memory: `Change To=value`: Value to which you want to change the maximum memory. `Change For=value`: Value to increment or decrement the maximum memory.
   ChangeMinMemoryAction | Change the minimum amount of memory that is available. | Class: Name of the action class. Properties: Enter one of the following properties to update the minimum memory: `Change To=value`: Value to which you want to change the minimum memory. `Change For=value`: Value to increment or decrement the minimum memory.
   ChangeShareMemoryAction | Change the share of memory that is available. The higher the value, the more memory share the resource will receive. | Class: Name of the action class. Properties: Enter one of the following properties to update the memore share: `Change To=value`: Value to which you want to change the memory share. `Change For=value`: Value to increment or decrement the memory share.

   Configuration Action Types (Process Group Scope)

   Configuration action types enable you to perform JMX operations on specified managed objects. Configuration action types have a process group scope. Select Configuration Action (JMX) from the Type drop-down list.

   Note: You must configure the JMX connections, as described in Configure JMX connections for JMX configuration actions.

   Property | Description
   --- | ---
   Connection | Name of the WebLogic Server connection to use to configure a JMX managed object.
   JMX Command | Click New to add a new JMX command. You must specify the following properties: Name: Name of the JMX command. Description: Description of the JMX command. This field is optional. MBean Instance Name: Fully qualified name of the MBean instance. For example: `com.bea:Name=AdminServer,Type=weblogic.management.runtime.ServerRuntimeMBean` Type: Type of JMX command. Valid values include: Create Command, Destroy Command, Set Attribute Command, and Invoke Operation Command. Based on the type of JMX command that you choose, you are prompted to enter command parameters as follows (no parameters are required if you select Destroy Command): Create Command Parameters: Class Name: Fully qualified name of the MBean class, including the package name. For example: `com.bea.barProduct.FooMBean` Loader Name: Name of the class loader. For example: `com.bea:Name=Classloader-1,Type=ClassLoader` Constructor Parameter Names, Parameter Types: Parameters names and types to construct the MBean. setAttribute Command Parameters: Attribute Name: Name of the attribute that you want to set. Attribute Values: Value to which you want to set the attribute. Invoke Operation Command Parameters: Operation Name: Name of the operation to invoke. Operation Parameter Names, Parameter Types: Parameter names and types to pass to the operation. Click Add to add the JMX command. To delete JMX commands, select the check box next to each JMX command that you want to delete and click Delete. For more information about the format to use to specify MBean attributes, see WebLogic Server MBean Reference.

4. Click Finish.

   The action is created and the following confirmation message is displayed:

   `New action created successfully`

After you finish

Perform one or more of the following tasks, as required:

- Create an action pipeline, as described in Define action pipelines.
- Assign a policy that runs an action when a service or process performs outside of its policy constraints, as described in Assign policies to services.
- Run an action, as described in Run actions.