Develop > Command-Line Interfaces > opr-config-tool Command-Line Interface

opr-config-tool Command-Line Interface

The opr-config-tool command-line interface enables you to list, update, and group templates, aspects, and management templates. You can add a template to an aspect, and display aspects and management templates that need to be updated before consuming a new template or aspect version.

Location

<OMi_HOME>/opr/bin/opr-config-tool.[bat|sh]

Synopsis

opr-config-tool {<operation> | -help | -version | -examples | -ping} <CONNECTION_INFO> [-verbose]

Options

Notes

  • The opr-config-tool CLI performs operations on both versioned and unversioned elements. Templates, aspects, and management templates are versioned, while template groups and config folders are unversioned. Versioned elements are displayed in the format <name> <version> <version ID>, and unversioned elements are displayed in the format <name> <id>.
  • Use opr-assign, opr-config-tool and opr-template together for an end-to-end CLI policy management workflow. For details, see Policy Management CLI workflows.

  • The generated output can be simple or nested. Simple output is defined as one single line. Nested output shows elements that belong together. For example, nested output could look like this:

    mt “myMT1” 1.5 <id_MT1>
      aspect “myAspect1” 4.7 <id_aspect1>
        aspect “myAspect1_1”  1.0  <id_aspect1_1>
    mt “myMT2” 3.4 <id_MT2>
      aspect “myAspect2” 1.2  <id_aspect2>

    In this example, the management template myMT1 contains the aspect MyAspect1 which, in turn, contains the aspect MyAspect1_1.

  • For list operations (-list and -list_containment), the output is sorted by name.
  • If you specify only the object or parent name as input parameter of a versioned element, by default the latest version of the object is displayed.
  • If you want more details, you can use the option -format xml. The XML format prints the output from the OMi internal web services without any further processing.

Tip Linux or cygwin users who want to process quoted input within shell scripts, for example after running opr-config-tool -list -type mt, can use the following commands:

$ while read l; do echo $l | xargs proc.sh; done </tmp/quotedInput

With quotedInput containing lines similar to "OMi Server Self-Monitoring" 3.2 c40033c7-34c2-4764-a420-5bd2927a175a. proc.sh is a shell script that executes just one command for illustration purposes: echo " $1 xx $2 xx $3"

Restrictions

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

  • List all templates:

    opr-config-tool -list -type template

  • Retrieve the myPolicy template for version 1.2:

    opr-config-tool -get -type t -name myPolicy -object_version 1.2

  • Delete myPolicy:

    opr-config-tool -list -delete -type t -name myPolicy

  • Show the aspects and management templates that do not consume the latest version of myPolicy:

    opr-config-tool -show_impacted -type t -name myPolicy

  • Update myAspect to consume the latest template versions:

    opr-config-tool -latest_update -type a -name myAspect

  • Preview which aspects and management templates would be generated when running latest_update for myMT:

    opr-config-tool -latest_update_preview -type mt -name myMT

  • List all templates in a template group with the id templateGroupID:

    opr-config-tool -list_containment -type template -parent_type template_group -parent_id templateGroupID

  • List all templates from myTemplateGroup:

    opr-config-tool -list_containment -type template -parent_type template_group -parent_name myTemplateGroup

  • Add myPolicy to the template group with the ID templateGroupID:

    opr-config-tool -create_containment -type template -name myPolicy -parent_type template_group -parent_id templateGroupID

  • Add myPolicy for version 1.2 to myAspect:

    opr-config-tool -create_containment -type template -name myPolicy -object_version 1.2 -parent_type aspect -parent_name myAspect

  • Delete myPolicy to the template group with the ID templateGroupID:

    opr-config-tool -delete_containment -type template -name myPolicy -parent_type template_group -parent_id templateGroupID

  • Delete myPolicy from myAspect:

    opr-config-tool -delete_containment -type template -name myPolicy -parent_type aspect -parent_name myAspect