chcondition Command

Purpose

Changes any of the attributes of a defined condition.

Syntax

To change the attributes of a condition:

chcondition [ -r resource_class ] [ -e "event_expression" ] [ -E "rearm_expression" ] [ -d "event_description" ] [ -D "rearm_description" ] [ -b interval[,max_events][,retention_period][,max_totalsize] ] [-m lm p ] [-n node_name1[,node_name2…]] [ --qnotoggle--qtoggle ] [-s "selection_string"] [-S cwi ] [ -g 0 | 1 | 2 ] [-h] [-TV] condition[:node_name]

To rename a condition:

chcondition -c new_condition [-h] [-TV] condition[:node_name]

To lock or unlock a condition:

chcondition { -L | -U } [-h] [-TV] condition[:node_name]

Description

The chcondition command changes the attributes of a defined condition to the values supplied. If the name of the condition is changed using the -c flag, any condition/response associations remain intact.

If a particular condition is needed for system software to work properly, it may be locked. A locked condition cannot be modified or removed until it is unlocked. If the condition you specify on the chcondition command is locked, it will not be modified; instead an error will be generated informing you that the condition is locked. To unlock a condition, you can use the -U flag. However, since a condition is typically locked because it is essential for system software to work properly, you should exercise caution before unlocking it. To lock a condition so it cannot be modified, use the -L flag.

If Cluster Systems Management (CSM) is installed on your system, you can use CSM defined node groups as node name values to refer to more than one node. For information about working with CSM node groups and using the CSM nodegrp command, see the CSM: Administration Guide and the CSM: Command and Technical Reference.

Flags

-b interval[,max_events][,retention_period][,max_totalsize]
Changes one or more batching-related attributes. Use commas to separate the attribute values. Do not insert any spaces between the values or the commas.

interval specifies that the events are to be batched together for the indicated interval. Batching continues until no events are generated for an interval. Use an interval of 0 to turn batching off.

max_events specifies that the events are to be batched together until the max_events number of events are generated. The interval restarts if the max_events number of events is reached before the interval expires.

retention_period specifies the retention period in hours. The batched event file is saved for the time specified as the retention period. Once this time is reached, the file is automatically deleted.

max_totalsize specifies the total size for the batched event file in megabytes (MB). The batched event file is saved until this size is reached. Once the size is reached, the file is automatically deleted.

max_events, retention_period, and max_totalsize cannot be specified unless interval is greater than 0. When interval is greater than 0 and max_events is 0, no maximum number of events is used.

If retention_period and max_totalsize are both specified, the batched event file is saved until the specified time or size is reached, whichever occurs first.

If you want to change one, two, or three attribute values, you must specify a valid value or an empty field for any attributes that precede the value you want to change. You do not have to specify any values for attributes that follow the value you want to change. For example, if you only need to change the retention period, you need to specify values for interval and max_events as well. You can provide an empty field if an attribute does not need to be changed. For example, to change the retention period to 36 hours without changing the values of interval and max_events, enter:
chcondition -b ,,36
-c new_condition
Assigns a new name to the condition. new_condition, which replaces the current name, is a character string that identifies the condition. If new_condition contains one or more spaces, it must be enclosed in quotation marks. A name cannot be null, consist of all spaces, or contain embedded double quotation marks.
-e "event_expression"
Specifies an event expression, which determines when an event occurs. An event expression consists of a dynamic attribute or a persistent attribute of resource_class, a mathematical comparison symbol ( or <, for example), and a constant. When this expression evaluates to TRUE, an event is generated.
-E "rearm_expression"
Specifies a rearm expression. After event_expression has evaluated to TRUE and an event is generated, the rearm expression determines when monitoring for the event_expression will begin again. Typically,the rearm expression prevents multiple events from being generated for the same event evaluation. The rearm expression consists of a dynamic attribute of resource_class, a mathematical comparison symbol (>, for example), and a constant.
-d "event_description"
Describes the event expression.
-D "rearm_description"
Describes the rearm expression.
--g 0 | 1 | 2
Specifies granularity levels that control audit logging for the condition. The levels of granularity are:
0
Enables audit logging. ERRM writes all activities to the audit log. This is the default value.
1
Enables error logging only. ERRM writes only in case of errors to the audit log.
2
Disables audit logging. ERRM does not write any records to the audit log.
-L
Locks a condition so it cannot be modified or removed. When locking a condition using the -L flag, no other operation can be performed by this command.
-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. The condition applies only to the local node (the node where the condition is defined). Only the local node is used in evaluating the selection string.
-L
Locks a condition so it cannot be modified or removed. When locking a condition using the -L flag, no other operation can be performed by this command.
m
Specifies management domain scope. The condition applies to the management domain in which the node where the condition is defined belongs. 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. All nodes in the peer domain are used in evaluating the selection string.
-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. Node group names can also be specified, which are expanded into a list of node names.

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.

The host name does not have to be online in the current configuration, but once the condition is monitored, the condition will be in error if the node does not exist. The condition will remain in error until the node is valid.

--qnotoggle
Specifies that monitoring does not toggle between the event expression and the rearm expression, but instead the event expression is always evaluated.
--qtoggle
Specifies that monitoring toggles between the event expression and the rearm expression.
-r resource_class
Specifies which resource class this condition will monitor. The lsrsrcdef command can be used to list the resource class names.
-s "selection_string"
Specifies a selection string that is applied to all of the resource_class attributes to determine which resources event_expression should monitor. The default is to monitor all resources within 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: Administration Guide .
-S c │ w │ i
Specifies the severity of the event:
c
Critical
w
Warning
i
Informational (the default)
-U
Unlocks a condition so it can be modified or removed. If a condition is locked, this is typically because it is essential for system software to work properly. For this reason, you should exercise caution before unlocking it. When unlocking a condition using the -U flag, no other operation can be performed by this command.
-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
Specifies the name of an existing condition that is defined on node_name.
node_name
Specifies the node in a domain where the condition is defined. 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.

Security

The user of the chcondition command needs write permission to the IBM.Condition resource class on the node where the condition is defined. Permissions are specified in the access control list (ACL) file on the contacted system. See the RSCT: Administration Guide 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_IP_AUTHENT
When the CT_IP_AUTHENT environment variable exists, the RMC daemon uses IP-based network authentication to contact the RMC daemon on the system that is specified by the IP address to which the CT_CONTACT environment variable is set. CT_IP_AUTHENT only has meaning if CT_CONTACT is set to an IP address; it does not rely on the domain name system (DNS) service.
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.

Implementation Specifics

This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.

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:
  1. To change the condition name from "FileSystem space used" to "Watch FileSystem space", run this command:
    chcondition -c "Watch FileSystem space"  "FileSystem space used"
  2. To change a rearm expression and rearm description for a condition with the name "tmp space used", run this command:
    chcondition -E "PercentTotUsed < 80" \
    -D "Start monitoring tmp again after it is less than 80 percent full" \       
    "tmp space used"
  3. To disable the recording of audit log information for the condition called "File System space used", run this command:
    chcondition -g 2 "File System space used"
  4. To change the maximum size of the batched event file for the condition called "File System space used" to 100 MB, run this command:
    chcondition -b ,,,100 "File System space used"
  5. To disable batching for the condition called "File System space used", run this command:
    chcondition -b 0 "File System space used"
    This command resets max_event, retention_period, and max_totalsize, if these values were previously specified. You must specify values for these attributes when you re-enable batching, if needed.
In the following examples, which apply to management domains, the node where the command is run is on the management server.
  1. To change the condition with the name "FileSystem space used" on the management server to check for space usage that is greater than 95%, run this command:
    chcondition -e "PercentTotUsed > 95" "FileSystem space used"
  2. To change the condition with the name "NodeB FileSystem space used" on NodeB to check for space usage that is greater than 95%, run this command:
    chcondition -e "PercentTotUsed > 95" \ 
    "NodeB FileSystem space used":NodeB
This example applies to a peer domain:
  1. To change the condition defined on NodeA with the name "FileSystem space used" to check for space usage that is greater than 95%, run this command:
    chcondition -e "PercentTotUsed > 95" \  
    "FileSystem space used":NodeA

Location

/usr/sbin/rsct/bin/chcondition