lsresponse Command

Purpose

Lists information about one or more responses.

Syntax

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

Description

The lsresponse command lists the following information about defined responses:
Field Description
ResponseName The name of the response.
Node The location of the response.
Action The name of an action.
DaysOfWeek

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 values are separated by commas (,). The number of DaysOfWeek values must match the number of TimeOfDay values. The values for each day follow:

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

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. Multiple TimeOfDay values are separated by commas (,). The number of DaysOfWeek values must match the number of TimeOfDay values.

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

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.

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

-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.
-A
Displays all of the attributes of the response.
-b
Displays only the responses that support event batching.
-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.
-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.
-l
Displays the response information on separate lines (long form).
-q
Does not return an error when response does not exist.
-t
Displays the response information in separate columns (table form).
-U
Indicates whether the resource is locked.
-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 Administering RSCT 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

  1. To list all of the responses, run this command:
    lsresponse 
    The output will look like this:
    ResponseName
    "E-mail root anytime"
    "E-mail root first shift"
    "Critical notifications"  
    "Generate SNMP trap" 
  2. To see which resources are locked, run this command:
    lsresponse -U
    The output will look like this:
    ResponseName                   Node      Locked 
    "Broadcast event on-shift"     "nodeA"   "No"   
    "E-mail root off-shift"        "nodeA"   "No"  
    "E-mail root anytime"          "nodeA"   "No"  
    "Log event anytime"            "nodeA"   "No"
    "Informational notifications"  "nodeA"   "No"
    "Warning notifications"        "nodeA"   "No"  
    "Critical notifications"       "nodeA"   "No"
    "Generate SNMP trap"           "nodeA"   "No"
  3. To list general information about the response "Critical notifications", run this command:
    lsresponse "Critical notifications"
    The output will look like this:
    ResponseName     = "Critical notifications"
    Node             = "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"
    StandardOut      = "y"
    EnvironmentVars  = '"Env1=5","Env=10"'
    UndefRes         = "n"
    
    ResponseName     = "Critical notifications"
    Node             = "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"
    StandardOut      = "y"
    EnvironmentVars  = ""
    UndefRes         = "n"
    
  4. 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"
  5. 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:
    ResponseName = "E-mail root anytime"
    Action       = "E-mail root"
    ⋮
    ResponseName = "E-mail root first shift"
    Action       = "E-mail root"

Location

/usr/sbin/rsct/bin/lsresponse