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

Commands Reference, Volume 3


mkresponse Command

Purpose

Creates a new response definition with one action.

Syntax

Creates a new response definition with one action.

Description

The mkresponse command creates a new response definition with the name specified by the Response parameter. One action must also be defined when the response is defined. Actions define commands to be run when the response is used with a condition and the condition occurs. The action defines days of the week when the action can be used, the time of day for those days of the week, the script or command to be run, what type of event causes the command to be run, the expected return code of the script or command, and whether to keep standard output. The days and times are paired so that different times can be specified for different days.

The chresponse command can be used to add actions to a response or to remove actions from a response. A response must always have at least one action defined. Monitoring can be started by using the startcondresp command. The startcondresp command links a response to a condition if they are not already linked.

Parameters

Response
The unique name of the new response to be created.

Flags

-c Existing_response
Copies an existing response. Links with conditions are not copied.

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

-e a | r | b
Specifies the type of event that causes the action being defined to run:

a
Event

r
Rearm event

b
Both event and rearm event

The default is event (a flag).

-h
Writes the command's usage statement to standard output.

-n Action
Specifies the name of the action being defined. Only one action can be defined when the response is created. Use the chresponse command to add more actions to the response.

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

-r Return_code
Specifies the expected return code for Action_script. If the expected return code is specified, 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.

-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 logevent, notifyevent, and wallevent for descriptions of the predefined response scripts provided with the application.

-t 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 value is 0000-2400. If no value is specified but a comma is entered, the default value is used.

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

Exit Status

0
Command has run successfully.

1
Error occurred with RMC.

2
Error occurred with CLI script.

3
Incorrect flag on command line.

4
Incorrect parameter on command line.

5
Error occurred that was based on faulty command line input.

Security

This command requires root authority.

Examples

  1. To define a response with the name "E-mail root anytime" that has an action named "E-mail root", to be used anytime Saturday and Sunday and uses the command /usr/sbin/rsct/bin/notifyevent root for both events and rearm events, type:
     mkresponse -n "E-mail root" -d 1+7  \                          
    -s "/usr/sbin/rsct/bin/notifyevent root" -e b   \          
    "E-mail root anytime"
    
  2. To define a response with the name "E-mail root anytime" that has an action named "E-mail root", to be used anytime Saturday and Sunday but only 8 am to 5 pm Monday through Friday and that uses the command /usr/sbin/rsct/bin/notifyevent root for events, type:
    mkresponse -n "E-mail root"     \                              
    -d 1+7,2-6  -t 0000-2400,0800-1700  \                          
    -s "/usr/sbin/rsct/bin/notifyevent root" -e a  \           
    "E-mail root anytime"
    
  3. To define a response with the name "E-mail root first shift" that has an action named "E-mail root" to be used Monday through Friday from 8 am to 6 pm, that uses the command /usr/sbin/rsct/bin/notifyevent root for rearm events, and that saves standard output in the audit log, expecting return code 5, type:
    mkresponse -n "E-mail root" -d 2-6  -t 0800-1800  \           
    -s "/usr/sbin/rsct/bin/notifyevent root" -e r  -o   \        
    -r 5  "E-mail root first shift"
    
  4. To define a response with the name "Critical notifications" as a copy of "Warning notifications", type:
    mkresponse -c "Warning notifications" "Critical notifications"
    

Files


/usr/sbin/rsct/bin/mkrespose Location of the mkrespose command.

Related Information

The chresponse, lsresponse, mkcondition, mkcondresp, rmresponse, startcondresp commands.

The rmccli General Information file.

The RSCT 2.2 Resource Monitoring and Control Guide and Reference contains more information regarding ERRM operations.


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