<!--Arbortext, Inc., 1988-2008, v.4002-->
<!DOCTYPE REFENTRY PUBLIC "-//Sun Microsystems//DTD SolBook 3.5//EN" [
<!ENTITY options-common SYSTEM "options-common.sgm">
<!ENTITY synopsis-common SYSTEM "synopsis-common.sgm">
<!ENTITY % commonents SYSTEM "common.ent">
%commonents;
]>
<?Pub UDT _bookmark _target>
<?Pub EntList bull rArr sect>
<?Pub Inc>
<refentry id="create-management-rule-1"><?Pub Tag atict:info tracking="off"
ref="2"><?Pub Tag atict:user user="hl34125" fullname=""><?Pub Tag atict:user
user="pmdavies" fullname=""><?Pub Tag atict:user user="ah95648" fullname="">
<!-- @(#)create-management-rule.1 1.14 07/07/26 SMI; -->
<refmeta><refentrytitle>create-management-rule</refentrytitle><manvolnum>1</manvolnum>
<refmiscinfo class="date">02 May 2007</refmiscinfo>
<refmiscinfo class="sectdesc">&man1;</refmiscinfo>
<refmiscinfo class="software">&software;</refmiscinfo>
<refmiscinfo class="arch">generic</refmiscinfo>
<refmiscinfo class="copyright">Copyright (c) 2007, Sun Microsystems, Inc.
All Rights Reserved</refmiscinfo>
</refmeta>
<refnamediv><indexterm><primary>create-management-rule</primary></indexterm>
<indexterm><primary>creates a new management rule</primary></indexterm>
<refname>create-management-rule</refname><refpurpose>creates a new management
rule</refpurpose></refnamediv>
<refsynopsisdiv><title></title>
<synopsis><command>create-management-rule</command> &synopsis-common; [<option
role="double-dash">ruleenabled</option>=<literal>true|false</literal>]
 [<option role="double-dash">ruledescription</option> <replaceable>description</replaceable>] [<option
role="double-dash">action</option> <replaceable>action-mbean-name</replaceable>]
 <option role="double-dash">eventtype</option> <replaceable>event-type</replaceable> [<option
role="double-dash">eventloglevel</option> <replaceable>log-level</replaceable>
 [<option role="double-dash">recordevent</option>=true|false] [<option
role="double-dash">eventdescription</option><replaceable> description</replaceable>]
 [<option role="double-dash">eventproperties</option> (property=value[:<replaceable>
property=value</replaceable>]*)]
 [<option role="double-dash">target</option> <replaceable><?Pub Caret>target</replaceable>] <replaceable>
rule-name</replaceable></synopsis>
</refsynopsisdiv>
<refsect1 role="description"><title></title>
<para>The <command>create-management-rule</command> creates a new management
rule to intelligently self-manage the installation and deployed applications. </para>
</refsect1>
<refsect1 role="options"><title></title>
<variablelist termlength="wholeline">&options-common;
<varlistentry><term><option role="double-dash">ruleenabled </option></term>
<listitem><para>Determines whether the rule is enabled or not. Default value
is true.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">ruledescription </option></term>
<listitem><para>Provides the description of the rule.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">action</option></term>
<listitem><para>The action MBean associated with the event.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">eventtype</option></term>
<listitem><para>Identifies the configured event as one of the predefined event
types.</para>
<?Pub Tag atict:add user="ah95648" time="1178129094"><itemizedlist>
<para>Valid values are:</para>
<listitem><para>cluster</para></listitem>
<listitem><para>lifecycle</para></listitem>
<listitem><para>log</para></listitem>
<listitem><para>monitor</para></listitem>
<listitem><para>notification</para></listitem>
<listitem><para>timer</para></listitem>
<listitem><para>trace</para></listitem>
</itemizedlist><?Pub /atict:add></listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">eventloglevel</option></term>
<listitem><para> Specifies at what level to record the event occurance in
server log file. Default value is INFO.</para>
<?Pub Tag atict:add user="ah95648" time="1178129211"><itemizedlist>
<para>Valid values are:</para>
<listitem><para>FINEST</para></listitem>
<listitem><para>FINER</para></listitem>
<listitem><para>FINE</para></listitem>
<listitem><para>CONFIG</para></listitem>
<listitem><para>INFO</para></listitem>
<listitem><para>WARNING</para></listitem>
<listitem><para>SEVERE</para></listitem>
<listitem><para>OFF</para></listitem>
</itemizedlist><?Pub /atict:add></listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">recordevent</option></term>
<listitem><para>Specifies whether the <?Pub Tag atict:del user="ah95648"
time="1179269503">occur<?Pub Tag atict:del user="ah95648" time="1179269485">a<?Pub
/atict:del>nce<?Pub /atict:del><?Pub Tag atict:add user="ah95648"
time="1179269503">occurrence<?Pub /atict:add> of the event is to be logged
or not. Default value is true. If no action is specified, the event <?Pub Tag atict:add
user="ah95648" time="1179269522">is<?Pub /atict:add><?Pub Tag atict:del
user="ah95648" time="1179269522">would be<?Pub /atict:del> logged.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">eventdescription</option></term>
<listitem><para>A description of the event.</para>
</listitem>
</varlistentry>
<varlistentry><term><option role="double-dash">eventproperties</option></term>
<listitem><para>The properties defined for the event.<?Pub Tag atict:add
user="ah95648" time="1178134473"> Different events have different properties.
If you do not specify a value for some properties, defaults are used. <?Pub Tag atict:del
user="hl34125" time="1185485512">For more information on<?Pub /atict:del><?Pub Tag
atict:add user="hl34125" time="1185485512">The following<?Pub /atict:add><?Pub Tag
atict:del user="hl34125" time="1185485521">the<?Pub /atict:del> properties <?Pub Tag
atict:add user="hl34125" time="1185485541">and their values are identified <?Pub
/atict:add>for each event type<?Pub Tag atict:add user="hl34125"
time="1185485551">:<?Pub /atict:add><?Pub Tag atict:del user="hl34125"
time="1185485551">, see <?Pub /atict:del><?Pub /atict:add></para>
<?Pub Tag atict:add user="hl34125" time="1185485678"><variablelist
termlength="wholeline">
<varlistentry><term><property>name</property></term>
<listitem><para>Notifies when the GMS starts, stops, or reports failure of
a server instance.</para>
<para>Values: <literal>start</literal>, <literal>stop</literal>, <literal>fail</literal></para>
<para>Event type: <literal>cluster</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>serverName</property></term>
<listitem><para>Specifies the server instances about which notifications are
given.</para>
<para>Values: A comma-separated list of server instance names, or <literal>*</literal> for
all server instances.</para>
<para>Event type: <literal>cluster</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>name</property></term>
<listitem><para>Specifies a server life cycle event. </para>
<para>Values: <literal>ready</literal>, <literal>shutdown</literal>, <literal>termination
</literal>.</para>
<para>Event type: <literal>lifecycle</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>loggerNames</property></term>
<listitem><para>(optional) Notifies when the specified loggers write messages
to the server log. </para>
<para>Values: A comma-separated list of logger names, or <literal>*</literal> for
all loggers, which is the default.</para>
<para>Event type: <literal>log</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>level</property></term>
<listitem><para>(optional) Notifies when messages of the specified level are
written to the server log.</para>
<para>Values: A comma-separated list of log levels.</para>
<para>Event type:<property> log</property></para>
</listitem>
</varlistentry>
<varlistentry><term><property>observedMbean</property></term>
<listitem><para>Specifies the name of the monitored MBean. Either this property
or <literal>observedObject</literal> must be specified.</para>
<para>Values: A <literal>name</literal> attribute of a user-defined MBean,
or a JMX <literal>ObjectName</literal> for a system MBean.</para>
<para>Event type: monitor</para>
</listitem>
</varlistentry>
<varlistentry><term><property>observedObject</property></term>
<listitem><para>Specifies the name of the monitored MBean. Either this property
or <literal>observedMbean</literal> must be specified.</para>
<para>Values: An <literal>object-name</literal> attribute of a user-defined
MBean, or a JMX <literal>ObjectName</literal> for a system MBean.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>observedAttribute</property></term>
<listitem><para>Specifies the monitored attribute of the monitored MBean.</para>
<para>Values: An MBean <literal>Attribute</literal> name.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>monitorType</property></term>
<listitem><para>The type of monitoring of the attribute.</para>
<para>Values: <literal>CounterMonitor</literal>, <literal>GaugeMonitor</literal>, <literal>
StringMonitor</literal></para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>granularityPeriod</property></term>
<listitem><para>(optional) Specifies the granularity at which the monitoring
data should be collected, in seconds.</para>
<para>Values: any numerical value representing the number of seconds of data
monitoring.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>notifyMatch</property></term>
<listitem><para>Specifies that the attribute value must match the <literal>stringToCompare
</literal> value. Either this property or <literal>notifyDiffer</literal> is
required if the monitor type is <literal>StringMonitor</literal>.</para>
<para>Values: <literal>true</literal> or <literal>false</literal></para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>notifyDiffer</property></term>
<listitem><para>Specifies that the attribute value must not match the <literal>stringToCompare
</literal> value. Either this property or <literal>notifyMatch</literal> is
required if the monitor type is <literal>StringMonitor</literal>.</para>
<para>Values: <literal>true</literal> or <literal>false</literal></para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>stringToCompare</property></term>
<listitem><para>Specifies the value to which the attribute value is compared.
Required if the monitor type is <literal>StringMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>numberType</property></term>
<listitem><para>Specifies the type of the numeric value being monitored. Required
if the monitor is of type <literal>CounterMonitor</literal> or <literal>GaugeMonitor
</literal>.</para>
<para>Values: <literal>byte</literal>, <literal>double</literal>, <literal>float</literal>, <literal>
int</literal>, <literal>long</literal>, <literal>short</literal></para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>differenceMode</property></term>
<listitem><para>Specifies the difference mode flag value common to all observed
MBeans. Required if the monitor is of type <literal>CounterMonitor</literal> or <literal>
GaugeMonitor</literal>.</para>
<para>Values: <literal>true</literal> or <literal>false</literal></para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>initThreshold</property></term>
<listitem><para>Specifies a value above which notification occurs. Required
if the monitor is of type <literal>CounterMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>offset</property></term>
<listitem><para>(optional) Specifies that the event should be re-triggered
when the <literal>initThreshold</literal> value plus this offset value is
reached. Applicable if the monitor is of type <literal>CounterMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>modulus</property></term>
<listitem><para>(optional) Specifies the modulus value common to all observed
MBeans. Applicable if the monitor is of type <literal>CounterMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>highThreshold</property></term>
<listitem><para>Specifies the upper limit of the range within which notification
occurs. Required if the monitor is of type <literal>GaugeMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>lowThreshold</property></term>
<listitem><para>Specifies the lower limit of the range within which notification
occurs. Required if the monitor is of type <literal>GaugeMonitor</literal>.</para>
<para>Event type: <literal>monitor</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>sourceMBean</property></term>
<listitem><para>Specifies a custom MBean that implements the JMX <literal>NotificationEmitter
</literal> interface. Either this property or <literal>sourceObjectName</literal> must
be specified.</para>
<para>Values: <literal>name</literal> of an Mbean</para>
<para>Event type: <literal>notification</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>sourceObjectName</property></term>
<listitem><para>Specifies a custom MBean that implements the JMX <literal>NotificationEmitter
</literal> interface. Either this property or <literal>sourceMBean</literal> must
be specified.</para>
<para>Values: <literal>object-name</literal> of Mbean</para>
<para>Event type: <literal>notification</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>type</property></term>
<listitem><para>(optional) Specifies the notification type. If this property
is specified, the action of the parent management rule is performed only if
the notification type emitted is same as this property's value.</para>
<para>Event type: <literal>notification</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>dateString</property></term>
<listitem><para>Begins notification at the specified date and time.</para>
<para>Values: Input format determined by the <literal>pattern</literal> property</para>
<para>Event type: <literal>timer</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>pattern</property></term>
<listitem><para>(optional) Specifies the date and time input format. The default
is <literal>mm/dd/yyyy hh:mm:ss</literal>.</para>
<para>Event type: <literal>timer</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>period</property></term>
<listitem><para>(optional) Notification repeats at the specified time interval
in miliseconds.</para>
<para>Event type: <literal>timer</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>numberOfOccurrences</property></term>
<listitem><para>(optional) Specifies the number of times notification occurs.</para>
<para>Event type: <literal>timer</literal></para>
</listitem>
</varlistentry>
<varlistentry><term>message</term>
<listitem><para>(optional) Specifies a message that is delivered as part of
timer notification.</para>
<para>Event type: <literal>timer</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>name</property></term>
<listitem><para>Notifies at the specified trace point.</para>
<para>Values: <literal>web_component_method_entry</literal>, <literal>web_component_method_exit
</literal>, <literal>ejb_component_method_entry</literal>, <literal>ejb_component_method_exit
</literal>, <literal>request_start</literal>, <literal>request_end</literal></para>
<para>Event type: <literal>trace</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>ipAddress</property></term>
<listitem><para>Specifies the IP address for which trace notifications are
sent.</para>
<para>Values: An IP address</para>
<para>Event type: <literal>trace</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>callerPrincipal</property></term>
<listitem><para>Specifies the caller principal for which trace notifications
are sent.</para>
<para>Event type: <literal>trace</literal></para>
</listitem>
</varlistentry>
<varlistentry><term><property>componentName</property></term>
<listitem><para>Specifies the component name for which trace notifications
are sent.</para>
<para>Event type: <literal>trace</literal></para>
</listitem>
</varlistentry>
</variablelist><?Pub /atict:add></listitem>
</varlistentry>
<varlistentry><term><option role="double-dash"></option><replaceable>target</replaceable></term>
<listitem><para>This operand specifies the target on which you are creating
a management rule. Valid values are:</para>
<itemizedlist>
<listitem><para><literal>server</literal>&hyphen; Specifies the default server
instance as the target for creating the management rule. <literal>server</literal> is
the name of the default server instance and is the default value.</para>
</listitem>
<listitem><para><replaceable>configuration_name</replaceable>&hyphen; Specifies
a particular configuration as the target for creating the management rule.</para>
</listitem>
<listitem><para><replaceable>cluster_name</replaceable>&hyphen; Specifies
a particular cluster as the target for creating the management rule.</para>
</listitem>
<listitem><para><replaceable>instance_name</replaceable>&hyphen; Specifies
a particular instance as the target for creating the management rule.</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="operands"><title></title>
<variablelist termlength="medium">
<varlistentry><term><replaceable>rule_name</replaceable></term>
<listitem><para>The name of the management rule.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="examples"><title></title>
<example><title>using create-management-rule command to create a monitor event</title>
<screen>asadmin> <userinput>create-management-rule --user admin 
--passwordfile adminpassword.txt --host localhost --port 4848 
--eventtype monitor --eventloglevel FINE 
--eventdescription "monitoring eventproperties" myRule1</userinput>
Command create-management-rule executed successfully</screen>
</example>
</refsect1>
<refsect1 role="exit-status"><title></title>
<variablelist termlength="narrow">
<varlistentry><term>0</term>
<listitem><para>command executed successfully</para>
</listitem>
</varlistentry>
<varlistentry><term>1</term>
<listitem><para>error in executing the command</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="see-also"><title></title>
<para><olink targetdoc="asrefman" targetptr="delete-lifecycle-module-1">delete-lifecycle-module(1)
</olink>, <olink targetdoc="asrefman" targetptr="list-lifecycle-modules-1">list-lifecycle-modules(1)
</olink></para>
</refsect1>
</refentry>
