Develop > Command-Line Interfaces > ConfigWsTool Command-Line Interface

ConfigWsTool command-line interface

You can use the ConfigWsTool command-line interface (CLI) to interact with Monitoring Automation using the Monitoring Automation web service API.

The tool enables you to use the web service API without having to set up a REST-based communication channel. It accepts commands and flat input files, and handles the communication details, making it especially useful for development and troubleshooting of external applications using the Monitoring Automation web service.

Location

<OMi_HOME>/opr/bin/ConfigWsTool.[bat|sh]

Synopsis

ConfigWsTool [<CONNECTION_INFO>] {<toolInfo> | <request>} [{‑verbose|‑v}] [{‑output|‑o} <outputFile>]

Note the following with respect to the optional parameters:

  • Specifying ‑verbose results in verbose output.
  • By default, the output is directed to the console. To redirect the output to an output file, specify the ‑output <outputFile> option, where the file name <outputFile> may contain path information. If path information is omitted, the file is stored in the current working directory.
  • All output and input files are formatted as XML.

Options

Exit status

Exit Status

Description

Output

0

Successful completion of the requested operation

No output.
1

Failure of the requested operation

An error message stating why the operation failed, followed by the tool's help text.
300‑399

HTTP Redirection (300-399)

An error message stating the HTTP error number and description.

For more information about HTTP error status values, see publicly available HTTP documentation.

400‑499

HTTP Client Error (400-499)

500‑599

HTTP Internal Server Error (500-599)

Note On Linux, ConfigWs Tool returns system error codes instead of HTTP status codes.

Restrictions

All operations require authorization. To operate the -list_assignment commands, the user must be an OMi user with permission to view assignments of the management template he wants to work with. To operate the -list_deployment_job command, the user needs full control for the Deployment Jobs interface. To operate the -list_management_template commands, the user needs viewing rights on the configuration folder containing the corresponding management templates. To operate the -create_assignment commands, the user needs full control permission for assignments of the management template, aspect, or template the user wants to assign. For more information about permissions, see Users, Groups, and Roles.

If <CONNECTION_INFO> is omitted when requesting an operation requiring authentication, ConfigWSTool does not execute the requested operation, and exits with the following error:

Username may not be null. Operation requires authentication. Please enter the login name and password.

The error can be fixed by inserting a valid <CONNECTION_INFO>.

Non-admin users also need the following file permissions to operate this command-line tool:

File Windows Permissions Linux Permissions
<OMi_HOME>/conf/TopazInfra.ini read r
<OMi_HOME>/log/opr-clis.log full control rw

<OMi_HOME>/log/opr-pgctl.log

Note: This file is not available on gateway server systems.
full control rw
<OMi_HOME>/conf/encryption.properties read r
<OMi_HOME>/conf/seed.properties read r

Examples

This section shows examples you can use as a starting point for developing your own ConfigWsTool commands.

All examples use basic authentication with the credentials myU/myPwd, and are executed on the local host.

  • List all management templates that can be assigned to a specific CI type

    Issue the following command to list all CI Types that can be assigned to a CI of the type myCIType:

    ‑lmtcit myCIType

    The management template IDs to be used for subsequent lists or assignments can be parsed from the response.

  • List all management template versions currently assigned to a specific CI

    Issue the following commands to list all management template versions that are currently assigned to a CI with the ID 5e2cef17df64ec4b35a0459e7ba33c8c:

    1. ‑laci 5e2cef17df64ec4b35a0459e7ba33c8c

    2. The response lists all current assignments for the CI. Parse the response, and for each assignment ID in the list, denoted as assgIdK, issue the following command:

      ‑la assgIdK

      The management template version IDs to be used for subsequent lists or assignments can be parsed from the response.

  • Create an assignment by using an explicitly specified combination of CI and management template

    Issue the following command to assign the management template version with version ID 430738c-796e-cfbd-9653-ee9fab02388a to the CI with the ID 5e2cef17df64ec4b35a0459e7ba33c8c:

    configwstool -user myU -pw myPwd -ca 5e2cef17df64ec4b35a0459e7ba33c8c c430738c-796e-cfbd-9653-ee9fab02388a

  • Create an assignment by using an input file

    Issue the following command to create an assignment using the XML input file \tmp\myAssg.xml:

    configwstool -user myU -pw myPwd -ca -i \tmp\myAssg.xml

  • Create an assignment from a draft assignment

    Issue the following command to retrieve a draft assignment of the management template version with version ID 430738c-796e-cfbd-9653-ee9fab02388a to the CI with the ID 5e2cef17df64ec4b35a0459e7ba33c8c:

    configwstool -user myU -pw myPwd -gda 5e2cef17df64ec4b35a0459e7ba33c8c c430738c-796e-cfbd-9653-ee9fab02388a -o \tmp\myDraft.xml

    The draft is stored as \tmp\myDraft.xml. Modify the file as required and save it, for example as file \tmp\myModifiedDraft.xml. Then, create a new assignment using the modified file as input file by issuing the following command:

    configwstool -user myU -pw myPwd -ca -i \tmp\myModifiedDraft.xml

  • Update all automatic assignments

    Issue the following command to retrieve all automatic assignment and update them to the latest version of a management template or aspect:

    configwstool -user myU -pw myPwd -ulau

    To use parameter values from existing automatic assignments, run the following command instead:

    configwstool -user myU -pw myPwd -ulau –ue