[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 1

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]
[-e a | r | b] [-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]

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.

Flags

-a
Adds the action specification to response.
-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 numbers of the days 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 matches 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 man pages for displayevent, logevent, notifyevent, and wallevent 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 | r | b
Specifies the type of event that causes the action being defined to run:
a
Specifies an event. This is the default.
r
Specifies a rearm event.
b
Specifies both an event and a rearm event.
-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's use only.
-V
Writes the command's verbose messages to standard output.

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 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:

  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 any time", run this command:
    chresponse -p -n "E-mail root" "E-mail root any time"
  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 /usr/sbin/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 any time", run this command:
    chresponse  -a  -n "E-mail root" -d 2-6 -t 0800-1800 \       
    -s "/usr/sbin/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root any time"
  3. To rename the response "E-mail root any time" to "E-mail root and admin any time", run this command:
    chresponse  -c "E-mail root and admin any time" "E-mail root any time" 

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 any time"
  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 /usr/sbin/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 any time" 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 "/usr/sbin/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root any time"
  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 any time":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 /usr/sbin/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 any time" 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 "/usr/sbin/rsct/bin/notifyevent root" -o  -r 5  \       
    "E-mail root any time":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 any time":nodeA

Location

/usr/sbin/rsct/bin/chresponse
Contains the chresponse command

Related Information

ERRM commands: lscondresp, lsresponse, mkcondresp, mkresponse, rmresponse

Files: rmccli

Books: see the RSCT Guide and Reference for more information about ERRM operations

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]