[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]
Commands Reference, Volume 3
mkcondition Command
Purpose
Creates
a new condition definition which can be monitored.
Syntax
mkcondition -r resource_class -e event_expression [-E rearm_expression] [-d event_description] [-D rearm_description] [-m l | m | p ] [-n node_name1[,node_name2...]] [-s "selection_string"] [-p node_name] [-S c |w |i] [-h] [-TV] condition
mkcondition -c existing_condition[:node_name] [-r resource_class]
[-e event_expression] [-E rearm_expression] [-d event_description]
[-D rearm_description] [-n node_name1[,node_name2...]] [-p node_name]
[-s"selection_string"] [-m l | m | p ] [-S c | w | i] [-h] [-TV] condition
Description
The mkcondition command creates a new condition with the name
specified by the condition parameter. The condition is used to
monitor a resource for the occurrence of the condition (or event). One or
more responses to an event can be defined by using the mkresponse command.
The conditions can then be linked to the responses by using the mkcondresp command, or by using the startcondresp command to link the
responses and start monitoring.
When in a cluster environment, use the -p flag to specify the node in the domain that
is to contain the condition definition. If the -p flag is not specified, the condition
is defined on the local node. If the node where the condition will be defined
is:
- in a cluster of nodes, the condition can monitor resources on more than
one node. Use the -n flag to specify the nodes on which the condition will be monitored.
- the management server in a management domain, a management scope (-m) of local (l) or management domain (m) can be specified
to indicate how the condition applies. The selection string will be evaluated
using the entire management domain when management scope is set to the management
domain and the node is the management server.
- a managed node in a management domain, only a management scope (-m) of local (l) can be used.
- in a peer domain, a management scope (-m) of peer domain (p) or local (l) can be used to indicate how the condition and
the selection string apply.
- in both a management domain and a peer domain, a management scope (-m) of management domain (m), peer domain (p), or local
(l) can be used to indicate how the condition and its selection
string apply.
Flags
- -c existing_condition[:node_name]
- Copies an existing condition. The existing condition is defined on node_name. If node_name is not specified, the local node is
used. node_name is a node within the scope determined by the CT_MANAGEMENT_SCOPE
environment variable. If any other flags are specified, update the new condition as indicated by the flags. Links with responses
are not copied.
- -r resource_class
- Specifies the resource class to be monitored by this condition. The lsrsrcdef command can be used to list the resource class names.
- -e event_expression
- Specifies the event expression, which determines when an event occurs.
It includes a dynamic attribute of the resource_class with a mathematical
comparison symbol (for example: >, <) and a constant. When this expression
evaluates to TRUE, an event is generated.
- -E rearm_expression
- Specifies the rearm expression. After the rearm_expression has
evaluated to TRUE and an event is generated, the rearm expression determines
when monitoring for the event_expression begins again. Typically,
the rearm expression prevents multiple events from being generated for the
same event evaluation. The rearm expression includes a dynamic attribute
of the resource_class with a mathematical comparison symbol (for
example, >) and a constant.
- -d event_description
- Specifies user-supplied text that describes the event expression.
- -D rearm_description
- Specifies user-supplied text that describes the rearm expression.
- -n node_name1[,node_name2...]
- Specifies the host name for a node (or a list of host names separated
by commas for multiple nodes) where this condition will be monitored. You
must specify the -m flag with a value of m or p if you want to use the -n flag. This way,
you can monitor conditions on specific nodes instead of the entire domain.
- -s "selection_string"
- Specifies a selection string that is applied to all of the resource_class properties to
determine which resources should be monitored by the event_expression. The default is to monitor all resources within the resource_class. The resources used to evaluate the selection string is determined
by the management scope (the -m flag). The selection string must be enclosed within double or single
quotation marks. For information on how to specify selection strings, see
the RSCT Guide and Reference.
- -S c | w | i
- Specifies the severity of the event:
- c
- Critical
- w
- Warning
- i
- Informational (for user reference). This is the default.
- -m l | m | p
- Specifies the management scope to which the condition applies. The management
scope determines how the condition is registered and how the selection string
is evaluated. The scope can be different from the current configuration, but
monitoring cannot be started until an appropriate scope is selected. The
valid values are:
- l
- Specifies local scope. This is the default.
The condition applies only to the local node (the node where the condition
is defined; see the -p flag). Only the local node is used in evaluating the selection string.
- m
- Specifies management domain scope. The condition
applies to the management domain in which the node where the condition is
defined belongs (see the -p flag). All nodes in the management domain are used in evaluating the
selection string. The node where the condition is defined must be the management
server in order to use management domain scope.
- p
- Specifies peer domain scope. The condition applies
to the peer domain in which the node where the condition is defined belongs
(see the -p flag). All nodes in the peer domain are used in evaluating the selection
string.
- -p node_name
- Specifies the name of the node where the condition is defined. This
is used in a cluster environment and the node name is the name by which the
node is known in the domain. The default node_name is the local
node on which the command runs. node_name is a node within the scope
determined by the CT_MANAGEMENT_SCOPE environment variable.
- -h
- Writes the command's usage statement to standard output.
- -T
- Writes the command's trace messages to standard error. For your software
service organization's use only.
- -V
- Writes the command's verbose messages to standard output.
Parameters
- condition
- The condition name is a character string that identifies the
condition. If the name contains spaces, it must be enclosed in quotation marks.
A name cannot consist of all spaces, be null, or contain embedded double quotation
marks.
Security
The user needs write permission for the IBM.Condition resource class to
run mkcondition. Permissions are specified in the access control
list (ACL) file on the contacted system. See the RSCT Guide and Reference for details on the ACL file and how to
modify it.
Exit Status
- 0
- The command ran successfully.
- 1
- An error occurred with RMC.
- 2
- An error occurred with a command-line interface script.
- 3
- An incorrect flag was entered on the command line.
- 4
- An incorrect parameter was entered on the command line.
- 5
- An error occurred that was based on incorrect command-line input.
Environment Variables
- CT_CONTACT
- Determines the system where the session with the resource monitoring
and control (RMC) daemon occurs. When CT_CONTACT is set to a host name or
IP address, the command contacts the RMC daemon on the specified host. If
CT_CONTACT is not set, the command contacts the RMC daemon on the local system
where the command is being run. The target of the RMC daemon session and
the management scope determine the resource classes or resources that are
processed.
- CT_MANAGEMENT_SCOPE
- Determines the management scope that is used for the session with the
RMC daemon in processing the resources of the event response resource manager
(ERRM). The management scope determines the set of possible target nodes
where the resources can be processed. The valid values are:
- 0
- Specifies local scope.
- 1
- Specifies local scope.
- 2
- Specifies peer domain scope.
- 3
- Specifies management domain scope.
If this environment variable is not set,
local scope is used.
Standard Output
When the -h flag is specified, this command's usage statement is written to standard
output. All verbose messages are written to standard output.
Standard Error
All trace messages are written to standard error.
Examples
These examples apply to standalone systems:
- To define a condition with the name "FileSystem space used" to check
for percentage of space used greater than 90% and to rearm when the percentage
is back down below 85%, enter:
mkcondition -r IBM.FileSystem \
-e "PercentTotUsed > 90" -E "PercentTotUsed < 85" \
"FileSystem space used"
- To define a condition with the name "tmp space used" to check for percentage
of space used greater than 90% for /tmp and to rearm
when the percentage is back down below 85%, including comments, enter:
mkcondition -r IBM.FileSystem \
-e "PercentTotUsed > 90" -E "PercentTotUsed < 85" \
-d "Generate event when tmp > 90% full" \
-D "Restart monitoring tmp again after back down < 85% full"\
-s 'Name=="/tmp"' "tmp space used"
- To define a condition with the name "Space used" as a copy of "FileSystem
space used", enter:
mkcondition -c "FileSystem space used" "Space used"
- To define a condition with the name "var space used" as a copy of "tmp
space used", but change the selection to /var, enter:
mkcondition -c "tmp space used" -s 'Name=="/var"' \
"var space used"
These examples apply to management domains:
- To define a condition with the name "FileSystem space used" to check
for percentage of space used greater than 90%, to rearm when the percentage
is back down below 85%, and to monitor all nodes in the domain, run this command
on the management server:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -n "*" -m d "FileSystem space used"
- To define a condition with the name "FileSystem space used" to check
for percentage of space used greater than 90%, to rearm when the percentage
is back down below 85%, and to monitor nodes nodeA and nodeB in the domain, run this command on the management server:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -n nodeA,nodeB -m d \
"FileSystem space used"
- To define a condition with the name "nodeB FileSystem space used" on nodeB to check for percentage of space used greater than 90%, to rearm
when the percentage is back down below 85%, and to monitor the condition with
local scope, run this command on the management server:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -n "*" -m l -p nodeB \
"nodeB FileSystem space used"
- To define a condition with the name "local FileSystem space used" to
check for percentage of space used greater than 90%, to rearm when the percentage
is back down below 85%, and to monitor the local node, run this command on
a managed node:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -m l "local FileSystem space used"
These examples apply to peer domains:
- To define a condition on nodeA with the name "FileSystem space
used" to check for percentage of space used greater than 90%, to rearm when
the percentage is back down below 85%, and to monitor all nodes in the domain,
run this command:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -m p -p nodeA "FileSystem space used"
- To define a condition on nodeC with the name "FileSystem space
used" to check for percentage of space used greater than 90%, to rearm when
the percentage is back down below 85%, and to monitor nodes nodeA and nodeB in the domain, run this command:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -n nodeA,nodeB -m p -p nodeC \
"FileSystem space used"
- To define a condition with the name "local FileSystem space used" on nodeB to check for percentage of space used greater than 90%, to rearm
when the percentage is back down below 85%, and to monitor the local node
only, run this command:
mkcondition -r IBM.FileSystem -e "PercentTotUsed > 90" \
-E "PercentTotUsed < 85" -m l "local FileSystem space used"
Location
- /usr/sbin/rsct/bin/mkcondition
- Contains the mkcondition command
Related Information
ERRM commands: chcondition, lscondition, mkcondresp, mkresponse, rmcondition, startcondresp
Files: rmccli
Books: see the RSCT Guide and Reference for more information about ERRM operations and about how to use
expressions and selection strings
[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home |
Legal |
Search ]