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

Commands Reference, Volume 3

lsresponse Command

Purpose

Lists information about one or more responses.

Syntax

lsresponse [ -C | -l | -t | -d | -D delimiter ] [-A] [-q] [-x] [-a] [-h] [-TV] [response1[,response2,...] :node_name]

Description

The lsresponse command lists the following information about defined responses:

Name
Specifies the name of the response.
Location
Specifies the location of the response.
Action
Specifies the name of an action.
DaysOfWeek

Specifies the days of the week when the action can be run. DaysOfWeek and TimeOfDay together define the interval when the action can be run.

The values for the days can be separated by plus signs (+) or displayed as a range of days separated by a hyphen (-). Multiple DaysOfWeek parameters are separated by commas (,). The number of DaysOfWeek parameters matches the number of TimeOfDay parameters. The values for each day follow:

1
Sunday
2
Monday
3
Tuesday
4
Wednesday
5
Thursday
6
Friday
7
Saturday
TimeOfDay

Specifies the time range when Action can be run, consisting of the start time followed by the end time separated by a hyphen. DaysOfWeek and TimeOfDay 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. Multiple TimeOfDay parameters are separated by commas (,). The number of DaysOfWeek parameters matches the number of TimeOfDay parameters.

ActionScript
Specifies the script or command to run for the action.
ReturnCode
Specifies the expected return code for ActionScript.
CheckReturnCode
Specifies whether the actual return code for ActionScript is compared to its expected return code. The valid values are: y (yes) and n (no).
EventType
Specifies the type of event that causes the action to be run: event, rearm event, or both.
StdOut
Specifies whether standard output is directed to the audit log. The valid values are: y (yes) and n (no).
EnvVars
Specifies any environment variables that will be set before the action is run. standard output is directed to the audit log. The valid values are: y (yes) and n (no).
UndefRes
Specifies whether the action is to be run if a monitored resource becomes undefined. The valid values are: y (yes) and n (no).

To get a list of all response names, run the lsresponse command alone without any response names specified. A list of all response names is returned. The default format in this case is tabular.

Specifying a node name after the response names limits the display to the responses defined on that node. List all of the responses on a node by specifying a colon (:) followed by the node name. The node name is a node within the management scope determined by the CT_MANAGEMENT_SCOPE environment variable. The management scope determines the list of nodes from which the responses are listed. For local scope, only responses on the local node are listed. Otherwise, the responses from all nodes within the domain are listed.

To see all the information about all response names, specify the -A flag with the lsresponse command. The -A flag causes all information about a response to be listed when no response names are specified. When all of the information about all responses is listed, the long format is the default.

When more than one response is specified, the response information is listed in the order in which the responses are entered.

Flags

-a
Specifies that this command applies to all nodes in the cluster. The cluster scope is determined by the CT_MANAGEMENT_SCOPE environment variable. If it is not set, first the management domain scope is chosen if it exists, then the peer domain scope is chosen if it exists, and then local scope is chosen, until the scope is valid for the command. The command will run once for the first valid scope found. For example, if both a management and peer domain exist, lsresponse -a with CT_MANAGEMENT_SCOPE not set will list the management domain. In this case, to list the peer domain, set CT_MANAGEMENT_SCOPE to 2.
-C
Displays the mkresponse command that can be used to create the response and one of its actions. If more than one response is specified, each mkresponse command appears on a separate line. This flag is ignored when no responses are specified. This flag overrides the -l flag.
-l
Displays the response information on separate lines (long form).
-t
Displays the response information in separate columns (table form).
-d
Specifies delimiter-formatted output. The default delimiter is a colon (:). Use the -D flag if you wish to change the default delimiter.
-D delimiter
Specifies delimiter-formatted output that uses the specified delimiter. Use this flag to specify something other than the default, colon (:). For example, when the data to be displayed contains colons, use this flag to specify another delimiter of one or more characters.
-A
Displays all of the properties of the response.
-q
Does not return an error when response does not exist.
-x
Suppresses headers when printing.
-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

response1[,response2,...]
This parameter can be a response name or a substring of a response name. You can specify more than one response name. When it is a substring, any defined response name that contains the substring is listed.
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 needs read permission for the IBM.EventResponse resource class to run lsresponse. 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

  1. To list all of the responses, run this command:
    lsresponse 
    The output will look like this:
    Name
    "E-mail root any time"
    "E-mail root first shift"
    "Critical notifications"  
    "Generate SNMP trap" 
    
  2. To list general information about the response "Critical notifications", run this command:
    lsresponse "Critical notifications"
    The output will look like this:
    Name             = "Critical notifications"
    Location         = "nodeA"
    Action           = "Log Critical Event"
    DaysOfWeek       = 1+2+7
    TimeOfDay        = 0000-2400
    ActionScript     = "/usr/sbin/rsct/bin/logevent /tmp/criticalEvents"                                       
    ReturnCode       = 0
    CheckReturnCode  = "y"
    EventType        = "b"
    StdOut           = "y"
    EnvVars          = '"Env1=5","Env=10"'
    UndefRes         = "n"
    
    Name             = "Critical notifications"
    Location         = "nodeA"
    Action           = "E-mail root"
    DaysOfWeek       = 6+2,6+2,6+5
    TimeOfDay        = 1700-2400,0000-0800,0000-2400
    ActionScript     = "/usr/sbin/rsct/bin/notifyevent root"
    ReturnCode       = 0
    CheckReturnCode  = "y"
    EventType        = "b"
    StdOut           = "y"
    EnvVars          = ""
    UndefRes         = "n"
    
    
  3. To list the command that would create the response "Critical notifications" along with one of its actions, run this command:
    lsresponse -C "Critical notifications"
    The output will look like this:
    mkresponse -n "Log Critical Event" -d 1+2+7 -t 0000-2400 \
    -s "usr/sbin/rsct/bin/logevent /tmp/criticalEvents"  \
    -e b -r 0 "Critical notifications"
  4. To list all responses that have the string E-mail in their names, run this command:
    lsresponse "E-mail"
    The output will look like this:
    Name   = "E-mail root any time"
    Action = "E-mail root"
    
    ·
    ·
    ·
    Name = "E-mail root first shift" Action = "E-mail root"

Location

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

Related Information

ERRM commands: chresponse, lscondresp, 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 ]