
Administration Commands                 create-management-rule(1)

NAME
     create-management-rule - creates a new management rule

SYNOPSIS
     create-management-rule
     [--terse={true|false}][ --echo={true|false} ]
     [ --interactive={true|false} ] [ --host  host]
     [--port port] [--secure| -s ] [ --user  admin_user]
     [--passwordfile filename] [--help]
     [ --ruleenabled =true|false]
     [--ruledescription description] [--action action-mbean-name]
     --eventtype event-type [--eventloglevel log-level
     [--recordevent=true|false] [ --eventdescription  description]
     [--eventproperties (property=value[:property=value]*)]
     [--target target] rule-name

DESCRIPTION
     The create-management-rule creates a new management rule  to
     intelligently  self-manage  the  installation  and  deployed
     applications.

OPTIONS
     -t --terse

         Indicates that any output data  must  be  very  concise,
         typically avoiding human-friendly sentences and favoring
         well-formatted data for consumption by a script. Default
         is false.

     -e --echo
         Setting to true will echo the command line statement  on
         the standard output. Default is false.

     -I --interactive

         If set to true (default),  only  the  required  password
         options are prompted.

     -H --host
         The machine name where the domain administration  server
         is running. The default value is localhost.

     -p --port

         The HTTP/S port for administration. This is the port  to
         which  you  should point your browser in order to manage
         the domain. For example, http://localhost:4848.

Java EE 5           Last change: 02 May 2007                    1

Administration Commands                 create-management-rule(1)

         The default port number is 4848.

     -s --secure

         If set to true, uses SSL/TLS  to  communicate  with  the
         domain administration server.

     -u --user
         The authorized domain administration server  administra-
         tive username.

         If you have authenticated to a domain using the  asadmin
         login  command,  then  you  need  not specify the --user
         option  on  subsequent  operations  to  this  particular
         domain.

     --passwordfile

         The --passwordfile option specifies the name,  including
         the full path, of a file containing the password entries
         in a specific format. The entry for  the  password  must
         have  the AS_ADMIN_ prefix followed by the password name
         in uppercase letters.

         For example, to specify the domain administration server
         password,  use  an  entry  with  the  following  format:
         AS_ADMIN_PASSWORD=password, where password is the actual
         administrator  password.  Other  passwords  that  can be
         specified        include        AS_ADMIN_MAPPEDPASSWORD,
         AS_ADMIN_USERPASSWORD, and AS_ADMIN_ALIASPASSWORD.

         All remote commands must specify the admin  password  to
         authenticate to the domain administration server, either
         through --passwordfile or  asadmin  login,  or  interac-
         tively  on the command prompt. The asadmin login command
         can be used only to  specify  the  admin  password.  For
         other  passwords, that must be specified for remote com-
         mands, use the --passwordfile or enter them at the  com-
         mand prompt.

         If you have authenticated to a domain using the  asadmin
         login command, then you need not specify the admin pass-
         word through the  --passwordfile  option  on  subsequent
         operations  to  this particular domain. However, this is
         applicable only to AS_ADMIN_PASSWORD  option.  You  will
         still  need to provide the other passwords, for example,
         AS_ADMIN_USERPASSWORD, as and when required  by  indivi-
         dual commands, such as update-file-user.

         For  security  reasons,  passwords   specified   as   an

Java EE 5           Last change: 02 May 2007                    2

Administration Commands                 create-management-rule(1)

         environment variable will not be read by asadmin.

         The  default  value   for   AS_ADMIN_MASTERPASSWORD   is
         changeit.

     --help

         Displays the help text for the command.

     --ruleenabled
         Determines whether the rule is enabled or  not.  Default
         value is true.

     --ruledescription

         Provides the description of the rule.

     --action
         The action MBean associated with the event.

     --eventtype

         Identifies the configured event as one of the predefined
         event types.

         Valid values are:

             o    cluster

             o    lifecycle

             o    log

             o    monitor

             o    notification

             o    timer

             o    trace

     --eventloglevel
          Specifies at what level to record the  event  occurance
         in server log file. Default value is INFO.

Java EE 5           Last change: 02 May 2007                    3

Administration Commands                 create-management-rule(1)

         Valid values are:

             o    FINEST

             o    FINER

             o    FINE

             o    CONFIG

             o    INFO

             o    WARNING

             o    SEVERE

             o    OFF

     --recordevent

         Specifies whether the occurrence of the event is  to  be
         logged  or  not.  Default value is true. If no action is
         specified, the event is logged.

     --eventdescription
         A description of the event.

     --eventproperties

         The properties defined for the event.  Different  events
         have  different  properties.   If  you  do not specify a
         value for some properties, defaults are used.  The  fol-
         lowing  properties  and  their values are identified for
         each event type:

         name
             Notifies when the  GMS  starts,  stops,  or  reports
             failure of a server instance.

             Values: start, stop, fail

             Event type: cluster

         serverName

             Specifies the server instances about which notifica-
             tions are given.

             Values: A comma-separated list  of  server  instance

Java EE 5           Last change: 02 May 2007                    4

Administration Commands                 create-management-rule(1)

             names, or * for all server instances.

             Event type: cluster

         name

             Specifies a server life cycle event.

             Values: ready, shutdown, termination.

             Event type: lifecycle

         loggerNames
             (optional) Notifies when the specified loggers write
             messages to the server log.

             Values: A comma-separated list of logger names, or *
             for all loggers, which is the default.

             Event type: log

         level

             (optional) Notifies when messages of  the  specified
             level are written to the server log.

             Values: A comma-separated list of log levels.

             Event type: log

         observedMbean
             Specifies the name of the  monitored  MBean.  Either
             this property or observedObject must be specified.

             Values: A name attribute of a user-defined MBean, or
             a JMX ObjectName for a system MBean.

             Event type: monitor

         observedObject

             Specifies the name of the  monitored  MBean.  Either
             this property or observedMbean must be specified.

             Values: An object-name attribute of  a  user-defined
             MBean, or a JMX ObjectName for a system MBean.

             Event type: monitor

Java EE 5           Last change: 02 May 2007                    5

Administration Commands                 create-management-rule(1)

         observedAttribute

             Specifies the monitored attribute of  the  monitored
             MBean.

             Values: An MBean Attribute name.

             Event type: monitor

         monitorType
             The type of monitoring of the attribute.

             Values: CounterMonitor, GaugeMonitor, StringMonitor

             Event type: monitor

         granularityPeriod

             (optional) Specifies the granularity  at  which  the
             monitoring data should be collected, in seconds.

             Values: any numerical value representing the  number
             of seconds of data monitoring.

             Event type: monitor

         notifyMatch
             Specifies that the attribute value  must  match  the
             stringToCompare   value.  Either  this  property  or
             notifyDiffer is required  if  the  monitor  type  is
             StringMonitor.

             Values: true or false

             Event type: monitor

         notifyDiffer

             Specifies that the attribute value  must  not  match
             the  stringToCompare  value. Either this property or
             notifyMatch is  required  if  the  monitor  type  is
             StringMonitor.

             Values: true or false

             Event type: monitor

Java EE 5           Last change: 02 May 2007                    6

Administration Commands                 create-management-rule(1)

         stringToCompare

             Specifies the value to which the attribute value  is
             compared.   Required  if the monitor type is String-
             Monitor.

             Event type: monitor

         numberType
             Specifies the type of the numeric value being  moni-
             tored.  Required  if the monitor is of type Counter-
             Monitor or GaugeMonitor.

             Values: byte, double, float, int, long, short

             Event type: monitor

         differenceMode

             Specifies the difference mode flag value  common  to
             all  observed  MBeans. Required if the monitor is of
             type CounterMonitor or GaugeMonitor.

             Values: true or false

             Event type: monitor

         initThreshold
             Specifies a value above which  notification  occurs.
             Required if the monitor is of type CounterMonitor.

             Event type: monitor

         offset

             (optional) Specifies that the event  should  be  re-
             triggered  when  the  initThreshold  value plus this
             offset value is reached. Applicable if  the  monitor
             is of type CounterMonitor.

             Event type: monitor

         modulus
             (optional) Specifies the modulus value common to all
             observed  MBeans.  Applicable  if  the monitor is of
             type CounterMonitor.

Java EE 5           Last change: 02 May 2007                    7

Administration Commands                 create-management-rule(1)

             Event type: monitor

         highThreshold

             Specifies the upper limit of the range within  which
             notification  occurs.  Required if the monitor is of
             type GaugeMonitor.

             Event type: monitor

         lowThreshold
             Specifies the lower limit of the range within  which
             notification  occurs.  Required if the monitor is of
             type GaugeMonitor.

             Event type: monitor

         sourceMBean

             Specifies a custom MBean  that  implements  the  JMX
             NotificationEmitter  interface. Either this property
             or sourceObjectName must be specified.

             Values: name of an Mbean

             Event type: notification

         sourceObjectName
             Specifies a custom MBean  that  implements  the  JMX
             NotificationEmitter  interface. Either this property
             or sourceMBean must be specified.

             Values: object-name of Mbean

             Event type: notification

         type

             (optional) Specifies the notification type. If  this
             property  is  specified,  the  action  of the parent
             management rule is performed only if  the  notifica-
             tion type emitted is same as this property's value.

             Event type: notification

Java EE 5           Last change: 02 May 2007                    8

Administration Commands                 create-management-rule(1)

         dateString

             Begins notification at the specified date and time.

             Values: Input format determined by the pattern  pro-
             perty

             Event type: timer

         pattern
             (optional) Specifies the date and time input format.
             The default is mm/dd/yyyy hh:mm:ss.

             Event type: timer

         period

             (optional) Notification  repeats  at  the  specified
             time interval in miliseconds.

             Event type: timer

         numberOfOccurrences
             (optional) Specifies the number of  times  notifica-
             tion occurs.

             Event type: timer

         message

             (optional) Specifies a message that is delivered  as
             part of timer notification.

             Event type: timer

         name
             Notifies at the specified trace point.

             Values:                  web_component_method_entry,
             web_component_method_exit,
             ejb_component_method_entry,
             ejb_component_method_exit,            request_start,
             request_end

             Event type: trace

Java EE 5           Last change: 02 May 2007                    9

Administration Commands                 create-management-rule(1)

         ipAddress

             Specifies the IP address for which  trace  notifica-
             tions are sent.

             Values: An IP address

             Event type: trace

         callerPrincipal
             Specifies  the  caller  principal  for  which  trace
             notifications are sent.

             Event type: trace

         componentName

             Specifies the component name for which trace notifi-
             cations are sent.

             Event type: trace

     --target
         This operand specifies  the  target  on  which  you  are
         creating a management rule. Valid values are:

             o    server- Specifies the default  server  instance
                  as the target for creating the management rule.
                  server  is  the  name  of  the  default  server
                  instance and is the default value.

             o    configuration_name- Specifies a particular con-
                  figuration  as  the  target  for  creating  the
                  management rule.

             o    cluster_name- Specifies a particular cluster as
                  the target for creating the management rule.

             o    instance_name- Specifies a particular  instance
                  as the target for creating the management rule.

OPERANDS
     rule_name                   The name of the management rule.

EXAMPLES

Java EE 5           Last change: 02 May 2007                   10

Administration Commands                 create-management-rule(1)

     Example 1 using create-management-rule command to  create  a
     monitor event

       asadmin> create-management-rule --user admin
       --passwordfile adminpassword.txt --host localhost --port 4848
       --eventtype monitor --eventloglevel FINE
       --eventdescription "monitoring eventproperties" myRule1
       Command create-management-rule executed successfully

EXIT STATUS
     0                   command executed successfully

     1                   error in executing the command

SEE ALSO
     delete-lifecycle-module(1), list-lifecycle-modules(1)

Java EE 5           Last change: 02 May 2007                   11

