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

Commands Reference, Volume 3


mkrsrc Command

Purpose

Defines a new resource.

Syntax

To define a new resource using data entered on the command line:

mkrsrc [-h] [-e] [-v] [-T] [-V] Resource_class Attr=value...

To define a new resource using data predefined in an input file:

mkrsrc [-h] -f Resource_data_input_file [-v] [-T] [-V] Resource_class

Description

The mkrsrc command requests the RMC subsystem to define a new resource instance for the class specified by the Resource_class parameter. At least one persistent attribute name and its value must be specified either as an parameter or by a resource definition file using the -f flag.

Prior to running mkrsrc, you should run the lsrsrcdef command to determine which attributes are required_for_define. Only attributes that have a property of required_for_define or optional_for_define can be defined using the mkrsrc command. The lsrsrcdef command also identifies the data type for each attribute. The value specified for each attribute must match this data type.

Parameters

Attr=value...
Attributes of the resource being defined. When defining a new resource instance, there are specific required attributes for each resource that must be defined. These attributes can be specified as parameters on the command line or defined in an input file by using the -f flag.

Attr
The name of a persistent attribute for this resource. This attribute must have a property of required_for_define or optional_for_define. Use the lsrsrcdef command to check the property.

value
The value for this persistent attribute. The data type for this value must match the defined data type for the value of this attribute. Use the lsrsrcdef command to verify the data type for each attribute.

Resource_class
The resource class name of the resource to be defined

Flags

-e
Displays two examples of suitable command line input for this command.

-f Resource_data_input_file
Specifies the name of the file which contains resource attribute information.

-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
Verifies that the input file or command line is valid. For example, check that all of the attribute names specified are defined and are either required_for_define or optional_for_define.

-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 with RMC that was based on faulty command line input.

Security

This command requires root authority.

Examples

  1. To create a new resource in the IBM.Host class, assuming you already know which persistent attributes are required when defining a resource of this class, type:
    mkrsrc IBM.Host Name=c175n05
    
  2. To create a new resource in the IBM.Processor class by first generating a template to aid in the defining of these resources, type:
    lsrsrcdef -i IBM.Processor > /tmp/IBM.Processor.rdef
    

    Then, edit the file /tmp/IBM.Processor.rdef and enter values for all of the attributes, substituting the type for an appropriate value, or leaving it blank for the default value.

    Finally, type:

    mkrsrc -f /tmp/IBM.Processor.rdef IBM.Processor
    
  3. To create two new IBM.Host resources using the information defined in file /tmp/IBM.Host.rdef, type:
    mkrsrc -f /tmp/IBM.Host.rdef IBM.Host
    

    Where the file /tmp/IBM.Host.rdef looks like:

    PersistentResourceAttributes::
    resource 1:
        Name        = c175n04
     
    resource 2:
        Name        = c175n05 
    
  4. This example creates a new resource in the IBM.Foo class. In this class, the Name and NodeList are required attributes. The Binary, SD, StringArray, and SDArray attributes are optional_for_define. This example shows how to enter the more difficult data types from the command line. The data types for the optional Binary, SD, StringArray, and SDArray attributes are self-explanatory. Type:
    mkrsrc IBM.Foo Name=c175n05 \
    NodeList={1} \
    Binary="0xaabbccddeeff00" \
    SD='[testing123,1,{2,4,6}]' \
    StringArray='{"testing 1 2 3",testing123,"testing 1 2 3"}' \
    SDArray='{["testing 1 2 3",1,{1,3,5}],[testing,2,{2,4,6}]}'
    
    Note:
    As discussed in the rmcli General Information file, attribute values for data types: structured data, array of structured data, and arrays containing strings enclosed in double quotation marks, should be enclosed in single quotation marks.

Files


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

Related Information

The lsrsrc, lsrsrcdef, rmrsrccommands.

The Resource Data Input file.

The rmccli General Information file.

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


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