Installing a monitor model using wsadmin in noninteractive mode

You can use wsadmin to install the EAR file using a script by accepting the defaults or by entering specific parameters.

This topic describes both accepting the defaults and entering specific parameters.

For information on using wsadmin to deploy the EAR file interactively, refer to Installing a monitor model using wsadmin in interactive mode.

If you use the install command, no prompts for input are displayed. The default values are instead used to install the EAR file.

The wsadmin commands presented in this task use Jacl; however, you can use these commands as examples that you can rewrite using Jython.

Using the install command with the defaults

Before you begin

Before you begin this task, start the WebSphere® Application Server associated with the monitor profile.

Procedure

  1. Open a command prompt, and change directories to the following directory: Monitor_Profile_Home/bin
  2. Type wsadmin to launch the wsadmin scripting client. If security is enabled, use the following command: wsadmin -user user_ID -password password
    where:
    • user_ID is the user ID for a WebSphere Application Server administrator
    • password is the password for user_ID
  3. Install the EAR file using the default values.
    In a stand-alone environment, use the following command:
    $AdminApp install path_to_Monitor_ear_file
    In a clustered environment, you must specify the application cluster where the model will be installed. Use the following command:
    $AdminApp install path_to_Monitor_ear_file {-cluster application_cluster_name}
    Tip: For Windows operating systems, you must use forward slashes instead of back slashes. Example: $AdminApp install C:/temp/myModel.ear
    If the first part of the deployment process was successful, you then see a list of messages. Verify that the following messages are in the list:
    • CWMLC0253I: Model [model_name] version [version_number] registration complete.
    • One or more messages that begin with CWMRT600*
    • ADMA5011I: The cleanup of the temp directory for application model_application_name is complete.
    • ADMA5013I: Application model_application_name installed successfully.
  4. After you have received all of the messages indicating that the deployment succeeded, type this command at the wsadmin prompt: $AdminConfig save. At this point, the last part of the deployment process occurs.
  5. To close the wsadmin prompt, type exit.
  6. Optional: If you are working in a secured environment, see the related task for an additional task you must perform to complete the installation of this model.

What to do next

When you use the default options during model installation, no event sources are assigned and the model is in an Inactive state. To begin processing events, at least one valid event source must be assigned to the model and the state must be changed to CreateNewInstances.

Using the install command and changing the defaults

If you use the install command but want to override the default values, you can specify new values by using either a Jython script or a Jacl script. This example uses Jython.

About this task

To run the script, follow these steps:

Procedure

  1. Open a command prompt, and change directories to Monitor_Profile_Home/bin.
  2. Type the following command:wsadmin -lang jython -f path_to_jython_script path_to_Monitor_ear_file
    Note: Use forward slashes, not back slashes, for Windows. For example: wsadmin -lang jython -f C:/temp/appInstall.py C:/temp/MyModel.ear

Example

Here is a sample script that specifies values for each of the IBM® Business Monitor installation tasks.
# For each install task, the fields must be passed in the correct order.
# To see the list of fields for a task, start wsadmin and run this command:
#   print AdminApp.taskInfo( '<path_to_ear_file>', '<task_name>' )
# For example:
#   print AdminApp.taskInfo( 'C:/temp/ClipsAndTacksApplication.ear', 'LifecycleClientDatabaseTask' )

# The LifecycleClientDatabaseTask task consists of the following 14 fields
# and the acceptable values:
#   "Run scripts to create the schema" = yes or no
#      default is yes
#   "Run scripts to enable Data Movement Services" = yes or no
#      default is no
#   "Run scripts to delete the schema during uninstallation" = yes or no
#      default is no unless the server is running in development mode
#   "Processing strategy" = SerialST or SerialMT
#       SerialST means "6.0.2 emulation"
#       SerialMT means "scalable"; this is the default
#   "Enable event reordering" = yes or no
#      default is no
#   "Enable KPI merge from previous version" = yes or no
#      default is yes
#   "Enable Business Situations merge from previous version" = yes or no
#      default is yes
#   "Is profile migration in process" = should always be no
#   "Generate Dashboard during monitor model installation" = yes or no
#      Defaults to yes if the server is in development mode and 
#      no if the server is not in development mode
#   "User to add for Business Space dashboard = user name 
#      Defaults to no additional user is added
#   "Name of Business Space dashboard" = dashboard name
#      Defaults to Model Name and version
#   "First field reserved for use by automatically generated models" = no
#      should always be no
#   "Second field reserved for use by automatically generated models" = no
#      should always be no
#   "Field reserved for use by custom models" = no
#      should always be no

createSchema = 'yes'
enableDMS = 'no'
deleteSchema = 'yes'
processingStrategy = 'SerialMT'
eventReordering = 'no'
kpiMerge = 'yes'
businessSituation = 'yes'
profileMigration = 'no'
generateDashboard = 'yes'
dashboardUserid = '' 
dashboardName = '' 

databaseTaskInfo = [ createSchema, enableDMS, deleteSchema, processingStrategy, eventReordering, kpiMerge, businessSituation, profileMigration, generateDashboard, dashboardUserid, dashboardName ]

# The LifecycleClientCognosTask task consists of the following field
# and the acceptable values:
#   "Publish Cognos cube package" = yes or no
#      default is yes

publishCubes = 'yes'

cognosTaskInfo = [ publishCubes ]
Remember: In the following example, if no event sources are assigned to the model, Event Consumption mode for model version must be set to Inactive.
# The LifecycleClientEventSourceTask task consists of the following 3 fields
# and the acceptable values:
#   “Local event transport mode” = ModelScopedIncomingEvents, VersionScopedIncomingEvents or blank ‘’ for auto-detect
#      default is auto-detect (‘’)
#   “List of remote event source IDs, separated by commas”
#      for example, ‘DEF-hostname1Cell01,DEF-hostname2Cell01’
#      default is no assigned event sources (‘’)
#   “Event Consumption mode for model version” = Inactive or CreateNewInstances
#      default is Inactive
# 
# To get a list of available event sources you can use:
#   AdminTask.wbmListCeiEventSources() or
#   AdminTask.wbmListDefEventSources() depending on the type of event sources the model is expecting

eventTransport = ''
eventSourceList = 'DEF-hostname1Cell01'
eventConsumption = 'CreateNewInstances'

eventTaskInfo = [ eventTransport, eventSourceList, eventConsupmtion ]
# The LifecycleClientDataSecurityTask task consists of the following 3 fields
# and the acceptable values:
#   "Create Resource Group" = existing or creating
#      default is existing
#   "Data Security resource group name" = name of resource group
#      default is root
#   "Resource Group Description" = description of resource group
#      only used when creating a resource group
#   "User name" = the user name to be assigned to a role
#   "User role" = the role for the user name
#      for example, KPI-Administrator

createResource = 'existing'
groupName = 'root'
groupDesc = ''
userName = 'admin'
userRole = 'KPI-Administrator'

securityTaskInfo = [ createResource, groupName, groupDesc, userName, userRole ]

# Turn on tracing if needed
# print AdminControl.trace('com.ibm.wbimonitor.*=all=enabled')

# Example of specifying values for 1 install task
#AdminApp.install(earName, ['-LifecycleClientEventSourceTask', [eventTaskInfo]]

# Example of specifying values for 2 install tasks
#AdminApp.install(earName,  ['-LifecycleClientDatabaseTask', [databaseTaskInfo], \
#   '-LifecycleClientEventSourceTask', [eventTaskInfo]]  )

# Example of specifying values for 3 install tasks
#AdminApp.install(earName,  ['-LifecycleClientDatabaseTask', [databaseTaskInfo], \
#   '-LifecycleClientCognosTask', [cognosTaskInfo], \
#   '-LifecycleClientCEITask', [ceiTaskInfo] ] )

# Example of specifying values for 4 install tasks
AdminApp.install(earName,  ['-LifecycleClientDatabaseTask', [databaseTaskInfo], \
   '-LifecycleClientCognosTask', [cognosTaskInfo], \
   '-LifecycleClientEventSourceTask', [eventTaskInfo], \
   '-LifecycleClientDataSecurityTask', [securityTaskInfo] ]  )

# Save the app
AdminConfig.save()