chresponse Command

Purpose

Adds or deletes the actions of a response or renames a response.

Syntax

To add an action to a response:

chresponse -a -n action [ -d days_of_week[,days_of_week…]] [-t time_of_day[,time_of_day…]] [-s action_script] [-r return_code] [ -b | [-e aA | b | er] ] [-o] [-E env_var=value[,env_var=value… ] ] [-u] [-h] [-TV] response[:node_name]

To delete an action from a response:

chresponse -p -n action [-h] [-TV] response[:node_name]

To rename a response:

chresponse -c new_response [-h] [-TV] response[:node_name]

To unlock or lock a response:

chresponse {-U | -L} [-h] [-TV] response[:node_name]

Description

The chresponse command adds an action to a response or deletes an action from a response. Actions define commands to be run when the response is used with a condition and the condition occurs. The chresponse command can also be used to rename a response.

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

Flags

-a
Adds the action specification to response.
-b
Specifies that the response, and all actions to be defined in this response, support event batching. For event batching, multiple events can be batched or grouped together and passed to a response. The actions of the response are directed to a file that contains the details for the batched events. A response that supports event batching can only be used for conditions that specify the events are to be batched.

The -b flag cannot be specified with the -e flag.

-p
Deletes action from response.
-c new_response
Specifies a new name to assign to the response. The new name must not already exist. The new name replaces the current name. The new_response name is a character string that identifies the response. 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.
-n action
Specifies the name of the action. When the -a flag is used, this is the name of the action being defined. When the -p flag is used, this is the name of the action to be deleted. Action names must be unique within a response. Only one action can be defined at a time.
-d days_of_week[,days_of_week…]

Specifies the days of the week when the action being defined can be run. days_of_week and time_of_day together define the interval when the action can be run.

Enter the numbers of the days separated by a plus sign (+) or as a range of days separated by a hyphen (-). More than one days_of_week parameter can be specified, but the parameters must be separated by a comma (,). The number of days_of_week parameters specified must match the number of time_of_day parameters specified. The default is all days. If no value is specified but a comma is entered, the default value is used. The values for each day follow:

1
Sunday
2
Monday
3
Tuesday
4
Wednesday
5
Thursday
6
Friday
7
Saturday
-t time_of_day[,time_of_day…]
Specifies the time range when action can be run, consisting of the start time followed by the end time, separated by a hyphen. days_of_week and time_of_day together define the interval when the action can be run.

The time is in 24–hour format (HHMM), where the first two digits represent the hour and the last two digits represent the minutes. The start time must be less than the end time because the time is specified by day of the week. More than one time_of_day parameter can be specified, but the parameters must be separated by a comma (,). The number of days_of_week parameters specified must match the number of time_of_day parameters specified. The default is 0000-2400. If no value is specified but a comma is entered, the default value is used.

-s action_script
Specifies the fully-qualified path for the script or command to run for the action being defined. See the displayevent, logevent, notifyevent, and wallevent commands for descriptions of predefined response scripts that are provided with the application.
-r return_code
Specifies the expected return code for action_script. The actual return code of action_script is compared to the expected return code. A message is written to the audit log indicating whether they match. If the -r flag is not specified, the actual return code is written to the audit log, and no comparison is performed.
-e a | A | b | e | r
Specifies the type of event that causes the action being defined to run:
a
Specifies an event. This is the default value.
A
Specifies any type of event (event, error event, or rearm event).
b
Specifies both an event and a rearm event.
e
Specifies an error event.
r
Specifies a rearm event.

More than one event type can be specified, for example: -e ae.

The -e flag cannot be specified with the -b flag.

-o
Directs all standard output from action_script to the audit log. The default is not to keep standard output. Standard error is always directed to the audit log.
-E env_var=value[,env_var=value…]
Specifies any environment variables to be set before action_script is run. If multiple env_var=value variables are specified, they must be separated by commas.
-u
Specifies that the action is to be run when a monitored resource becomes undefined.
-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 use only.
-V
Writes the command's verbose messages to standard output.
-U
Unlocks a response so it can be modified or removed. If a response 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 response using the -U flag, no other operation can be preformed by this command.
-L
Locks a response so it cannot be modified or removed. When locking a response using the -L flag, no other operation can be performed by this command.

Parameters

response
Specifies the name of the response to be changed.
node_name
Specifies the node where the response 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 chresponse command needs write permission to the IBM.EventResponse resource class on the node where the response 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. In this example, the action named "E-mail root" cannot be the only action. To delete "E-mail root" from the response named "E-mail root anytime", run this command:
    chresponse -p -n "E-mail root" "E-mail root anytime"
  2. In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM, will use the command /opt/rsct/bin/notifyevent root, will save standard output in the audit log, and will expect return code 5 from the action. To add "E-mail root" to the response named "E-mail root anytime", run this command:
    chresponse  -a  -n "E-mail root" -d 2-6 -t 0800-1800 \       
    -s "/opt/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root anytime"
  3. To rename the response "E-mail root anytime" to "E-mail root and admin anytime", run this command:
    chresponse  -c "E-mail root and admin anytime" "E-mail root anytime" 
These examples apply to management domains:
  1. To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined on the management server, run this command on the management server:
    chresponse -p -n "E-mail root" "E-mail root anytime"
  2. In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM, will use the command /opt/rsct/bin/notifyevent root, will save standard output in the audit log, and will expect return code 5 from the action. To add "E-mail root" to the response "E-mail root anytime" that is defined on the management server, run this command on the management server:
    chresponse  -a  -n "E-mail root" -d 2-6 -t 0800-1800 \       
    -s "/opt/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root anytime"
  3. To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined on the managed node nodeB, run this command on the management server:
    chresponse -p -n "E-mail root" "E-mail root anytime":nodeB
These examples apply to peer domains:
  1. In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM, will use the command /opt/rsct/bin/notifyevent root, will save standard output in the audit log, and will expect return code 5 from the action. To add "E-mail root" to the response "E-mail root anytime" that is defined on node nodeA in the domain, run this command on any node in the domain:
    chresponse  -a  -n "E-mail root" -d 2-6 -t 0800-1800 \       
    -s "/opt/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root anytime":nodeA
  2. To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined on node nodeA in the domain, run this command on any node in the domain:
    chresponse -p -n "E-mail root" "E-mail root anytime":nodeA

Location

/opt/rsct/bin/chresponse