Skip to content
CA Service Management - 14.1
Documentation powered by DocOps

The GRLoader Command

Last update December 16, 2016

This article contains the following topics:

The General Resource Loader (GRLoader) imports CI information into CA SDM. GRLoader uses XML documents as input, which lets you import data that originates in different data sources. Run GRLoader from a command prompt or by using a .bat or .cmd file. The CA SDM installation adds the GRLoader to the path during installation, so it runs from any directory.

Results from an import show counts for all processed CIs and Relationships, including the amount of Read, Skipped, Inserts, Updates, Errors, and Warnings. GRLoader logs all processing details and errors in the nx_root/log/grloader.log file, where nx_root specifies the CA SDM installation directory.

Syntax

C:\WINDOWS>GRLoader -?

The GRLoader command uses the following parameters:

  • -u userid
    (Required) Specifies the user ID that runs the GRLoader process.
  • -p password
    (Required) Specifies the password for the user ID. If you run GRLoader without the -p parameter, the utility prompts the console for the password.
  • -s http[s]://cmdb_servername:port
    (Required) Specifies the server URL including the port number that runs the web services. For running GRLoader on the primary server or application server in a default installation, you can use the following command:

    -s http://localhost:8080
    
    Note: If you specify the optional -C parameter, GRLoader ignores the -s parameter.
  • -i input_file
    (Required) Specifies a full path name or a relative path name. If the filename contains a .xls or .xlsx suffix, GRLoader considers the file as a spreadsheet, otherwise it considers it as an XML file.
  • -n
    (Optional) Allows new CI insertion into the CMDB. Without -n, CIs write to the XML error file (see the -e parameter). Relationships are only added if either -n or -a is specified. If neither is specified, no updates are performed. Updating CIs also require the -a parameter.
  • -a
    (Optional) Allows updates to configuration items (by default, updates are not allowed if the CI exists in the CMDB). The -n flag also is required to add new CIs.
  • -D
    (Optional) Specifies a name prefix for relations (defaults to "GRLoader"). Use the prefix for the sym field in new relationships. The sym file must be unique, so a datetime field and a number is appended to this prefix to make it unique. 
    Default Prefix: GRLoader.
  • -e XML_err_file
    (Optional) Produces an XML error file when GRLoader detects errors or warnings. By default, the error file name uses the name of the input file, appended with _err.xml. For example, using the input file as abc.xml creates the error file as abc_err.xml. Use the -e parameter to override this default name.
  • -E
    (Optional) Lets you overwrite the XML error file. By default, the error file is not overwritten.
  • -I
    (Optional) Ignores case. When you use this parameter, GRLoader is not case-sensitive when comparing the input value of a lookup field with the actual value stored in the database. By default, lookups are case-sensitive.
  • -ua
    Always updates the CMDB.
  • -lftwa [-chg nnnn
    (Optional) Loads TWA transactions into the CMDB. If used with -chg, the load selects only those transactions associated with change order nnnn.

    Note: The Change Order string is not validated when loaded into the CMDB.
  • -lftwai [-chg nnnn]
    (Optional) Runs TWA transactions to update the CMDB. Transactions that run successfully are set to Inactive so that they do not appear in lists. If you use -chg, the load selects only those transactions associated with change order nnnn.
  • -lttwa 
    (Optional) Loads XML into the transaction work area (TWA) instead of directly into the CMDB. After data has been loaded into the TWA, it can be edited, changed and verified. After the data modification process completes, individual transactions can load into the CMDB (see - lftwa).
  • -lttwar
    (Optional) Loads XML into the initial state in the transaction work area (TWA) instead of directly into the CMDB. Transaction data in the TWA can be edited, changed, and verified (see -simci and -simrel). After the data modification process completes, individual transactions can load into the CMDB (see - lftwai).
  • -nospinner (-spinner)
    (Optional) Turns off the spinner that displays CI and relationship progress. Use -spinner to enable the progress display.
  • -P
    (Optional) Specifies preload data to improve performance for large processing. For large input files, supplying the - P parameter preloads a few tables into memory so that they can be processed more quickly. For smaller inputs (< 50 entries), preload is not necessary.
  • -rs
    (Optional) Replaces symbolic values that CA SDM includes in the XML input file. If you enable this parameter, corresponding values replace the following symbolic values:
    • *now* -- Replaced by a unique date/time string appended with a sequence number to help ensure uniqueness.
    • *userid* -- Indicates the userid specified in the -u parameter.
    • *inputfile* -- Indicates the filename specified in the -I parameter.
    • *relationcount* -- Specifies the number of relationships processed so far in this GRLoader run.
    • *lastciuuid* -- Specifies the UUID of the most recently processed CI.
    • *cicount* -- Specifies the number of CIs processed so far in this GRLoader run.

Examples: Use the -rs Parameter

With -rs enabled, the following example creates 100 CIs named ci1, ci2, …, ci100

<GRLoader>
<ci><name>ci*cicount*</name><class>Server</class></ci> 
[...repeated 100 times...]
</GRLoader>

With -rs enabled, the following example updates the CI description with information about the most recent update.

<GRLoader>
<ci>
<name>server1</name>
<description>updated by *userid* on *now* using input file *inputfile*</description>
</ci>
</GRLoader>
  • -simci
    (Optional) Simulates CI operations to predetermine whether a set of transactions creates CIs, and therefore possible ambiguities for other CIs.
  • -simrel
    (Optional) Simulates relationship operations to predetermine whether a relationship transaction creates a relationship or updates a relationship.
  • -T trace_level
    (Optional) Specifies the tracing level. Known tracing levels are 0 (off, the default), 1 (low), 5 (medium) and 10 (verbose). We recommend only using this setting when necessary because much output can result.
  • -tf filename
    (Optional) Runs GRLoader using translation rules. filename specifies the name of the file that contains the translation rule set.
  • -slump
    (Optional) Specifies the slump.jar file. This parameter can provide better performance than web services. Important: -slump only can be used with the -s parameter to target the following server:
    • Conventional: Primary server
    • Advanced Availability: Application server.
    Note: If another CA product is installed, for example, CA Coheshion ACM or CMDB service pack is installed, verify that the slump.jar file is identical to the one that is installed on the target CA SDM system.
  • -C
    (Optional) Validates the XML input file without any additional processing. This argument only validates the XML tags, not field values.
  • -h (or -?)
    (Optional) Displays online help.
  • -v
    (Optional) Displays the GRLoader product version and build date.
  • -maxerror number
    (Optional) Specifies the maximum number of errors that can occur before remaining CIs or relationships are skipped.
  • -maxwarn number
    (Optional) Specifies the maximum number of warnings that can occur before remaining CIs or relationships are skipped.
  • -chg nnnn
    Used with - lftwa and -lftwar. Loads only those transactions associated with change order nnnn.

    Note: The Change Order string is not validated when loaded into the CMDB.
  • -cfg myconfigfile.cfg
    (Optional) Specifies the name of the input configuration file.
  • -dt tenant
    (Optional) Specifies the tenant assignment for the CI/relationship. You must enable multi-tenancy to use this parameter. You can use PUBLIC to indicate that the object is public. If the tenant access of the user does not authorize creating public objects, the object is created using the default tenant.

  • -sc classname

    Lists the attributes of CIs in the class you specify.
  • -scx classname

    Lists the attributes of CIs in the class you specify in XML format. The XML is stored in a file named classname.xml. Any special characters are removed from the class name.

Example: Load CI and Relationship Data

The following example loads the CI and relationship data contained in the filehardware_servers.xml (in the current directory) into the CMDB that resides on the server located on the local computer on port 8080.

grloader -u CMDBAdmin -p password -s http://localhost:8080 -i hardware_servers.xml -n

JDBC Database Input Options

The following table lists the options that you use in the configuration file and the corresponding command line options when you input JDBC databases.

Note: If you use SQL Server or Oracle databases, CA SDM includes the required JAR files. If you use other database types, you must use the -addjar option to add support for those databases to GRLoader dynamically. Consult your database vendor documentation for the name and location of the necessary JAR files to use JDBC. You can also consult your database vendor or database administrator for specific values and credentials.

GRLoader Option Command Line Option Description
grloader.jdbc.driver=name -dbdriver name Specifies the JDBC driver name.
Note: This driver must be available on the classpath, similar to -addjar. Consult the database vendor for specific values.
grloader.jdbc.url=URL -dburl URL Specifies the JDBC database URL that describes the location of the database which contains the table you want to load.
grloader.jdbc.user=name -dbuser name Specifies the user ID for the JDBC database.
grloader.jdbc.password=password -dbpswd password Specifies the password for the user ID for the JDBC database.
grloader.jdbc.statement=statement -dbstmt statement Specifies the JDBC statement that describes the columns and selection criteria for the data you want to import.
Note: The column names used in the query statement must match CMDB attribute names. If these names differ, use the SQL AS keyword to map database column names to CMDB attributes.

Spreadsheet Input Options

The following table lists the options that you use in the configuration file and the corresponding command line options when you input spreadsheets. You can also usethe {} symbols as delimiters surrounding the lookup field as well as using the keyword EMPTY.

  • boolean
    Specifies a value from one the following pairs: 1/0, YES/NO, or TRUE/FALSE.

Note: If the input file name ends in .xls or .xlsx when you use the grloader.inputfile=name GRLoader option or the -i command line argument, GRLoader assumes that it is a spreadsheet.

GRLoader Option Command Line Option Description
grloader.spreadsheet.filename=name -ssf Specifies the Excel spreadsheet file name when it does not contain the .XLS or .XLSX file extension.
grloader.spreadsheet.sheetname=name -sss Specifies the sheet name.
Default: The first sheet in the spreadsheet.
grloader.spreadsheet.firstrow=n -ssfr Set this value to skip over the first n-1 rows in the spreadsheet.
grloader.spreadsheet.lastrow=n -sslr Ignores rows> n (greater than) in the spreadsheet.
grloader.spreadsheet.firstcol=x -ssfc Specifies to start processing on this column.
You can express this column as a letter or number, depending on your spreadsheet options.
grloader.spreadsheet.lastcol=x -sslc Ignores columns > x (greater than) in the spreadsheet.
You can express this column as a letter or number, depending on your spreadsheet options.
grloader.spreadsheet.embeddedseparator -sses Specifies a character to separate multiple values contained in a single cell.
This option only applies to the relationship type column in a row with multiple embedded relationships.
Default: semi-colon ":"
grloader.attributedefault.atrname=value -ad attrname=value Provides a default value if you did not specify one in the input source.
Note: These values do not undergo attribute name or data value translation.
Note: When you run GRLoader from a batch file, specify the -ad attr=value as -ad attr{value} to get past the Windows command parser which may remove the equal "=" symbols.
  -dt Deprecated.
Instead, use the -ad tenant=name option.
grloader.maxci=n -maxci Specifies the maximum number of CIs to import before skipping further CI imports.
grloader.maxrel=n -maxrel Specifies the maximum number of relationships to import before skipping further relationship imports.
N/A -sc classname Lists the attirbutes of CIs in the class you specify.
N/A -scx classname Lists the attributes of CIs in the class you specify in XML format.
grloader.workarea.changeorderrequired=boolean -cor If set to yes, TWA transactions that do not contain a non-blank change order number are ignored.
grloader.ignoreinvalidattributes=boolean -iia Specifies if you want to ignore invalid attributes. This command suppresses all warning messages about invalid attribute names.

CSV Input Options

The following table lists the options that you use in the configuration file and the corresponding command line options when you input CSV files.

Note: If required, consult your database vendor or database administrator for specific values and credentials.

GRLoader Option Command Line Option Description
-i   GRLoader assumes that a file ending in .csv is a CSV file.
grloader.csv.filename=name -csvf name Specifies the filename when it does not end in .csv.
grloader.csv.separator=x -csvsep x Specifies when the CSV file uses other than comma delimiters.
You can specify a single character, such as a Tab (\t) or a semicolon.
grloader.csv.escape=x -csvesc x Specifies when the CSV file uses an escape character (\).
grloader.csv.comment=x -csvcom x Specifies when the CSV file uses the comment character (#).
grloader.csv.quote=x -csvquote x Specifies when the CSV file uses the quote character (").

TWA Input Options

The following table lists the options that you use in the configuration file and the corresponding command line options when you input from the TWA.

GRLoader Option Command Line Option Description
grloader.workarea.changeorderrequired=yes/no -cor GRLoader ignores TWA transactions that do not contain a non-blank Change Order number.
     

General Options

The following table lists the options that you use in the configuration file and the corresponding command line options when you input from all inputs.

Note: If necessary, consult your database vendor or database administrator for specific values and credentials.

GRLoader Option Command Line Option Description
grloader.system.addjar=xx;yy;zz -addjar xx Adds JAR files to the GRLoader classpath. You can use this option with - jdbcdriver.
Note: The grloader.system.addjar option can only appear once in the configuration file. You can add multiple jars through grloader.system.addjar by separating the filenames with a semi-colon. This option only specifies a single jar file, and you can specify it as many times as required.
grloader.attributedefault.attrname=value -ad attrname=value Provides a default value if you did not specify a value in the input source.
Note: These values do not undergo attribute name or data value translation. When you run GRLoaderfrom from a batch file, specify -ad attr=value as -ad attr{value}. The Windows command parser can delete the equals symbol.
N/A -ad tenant=name Specifies the tenant name.
grloader.maxci=n -maxci n Specifies the maximum number of CIs to import before skipping further CI imports.
grloader.maxrel=n -maxrel n Specifies the maximum number of relationships to import before skipping further relationship imports.
N/A -sc xx Lists attributes of CIs in the class xx.
N/A -scx xx Lists attributes of CIs in class xx in XML format.
grloader.reader.allowembeddedrelationships=yes/no -aer Allows embedded relationships.
Default: Yes
For backward compatibility only
grloader.ignoreinvalidattributes=yes/no -iia Ignores invalid attributes by suppressing all warning messages about invalid attribute names.
grloader.updatealways=yes/no    

Example Display CI Class Attributes

When you create input for GRLoader, list the attributes associated with a specific class.

To list the attributes, execute the following command:

grloader  - u username  - p password  - s http://sdm-host:8080 -sc [class name]
  • sc
    Lists attributes of CIs in a class that you specify.
  • class name
    Specifies any valid CA CMDB class name.

Example: List Attributes for Class Server

grloader  - u username  - p password  - s http://sdm-host:8080 -sc Server

10:33:01.997 CI and Relationship Loader for CA Service Desk Manager 

List of attributes in class(Server) extension(har_serx)

ATTRIBUTE NAME                      DATA TYPE
acquire_date                        Date
active_date                         Date
alarm_id                            STRING(64)
ambiguity                           Integer
asset_count                         Integer
asset_num                           STRING(64)
audit_userid                        SREL(cnt.combo_name)

Example Display CI Class Attributes in XML Format

When you create input for GRLoader, list the attributes associated with a specific class in XML format. The command creates the file [class name].xml with the result.

To list the attributes in XML format, execute the following command:

grloader  - u username  - p password  - s http://sdm-host:8080 -scx [class name]
  • scx
    Lists attributes of CIs in XML format in a class that you specify.
  • class name
    Specifies any valid CA CMDB class name.

Example: List Attributes for Class Server

grloader  - u username  - p password  - s http://sdm-host:8080 -scx Server

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<GRLoader>
 <ci>
    <acquire_date></acquire_date>                       <!-- Date -->
    <active_date></active_date>                         <!-- Date -->
    <alarm_id></alarm_id>                               <!-- String(64) -->
    <ambiguity></ambiguity>                             <!-- Integer -->
    <asset_count></asset_count>                         <!-- Integer -->
    <asset_num></asset_num>                             <!-- String(64) -->
    <audit_userid lookup="combo_name"></audit_userid>   <!-- SREL cnt -->


Note: If the class name contains special characters, they are removed.

Was this helpful?

Please log in to post comments.