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

opr-tool Command-Line Interface

You can use the opr-tool command-line interface (CLI) to interact with tools using the Tool Execution web service API.

The CLI enables you to use the web service API without having to set up a REST-based communication channel.

For information on the Tool Execution web service, see Tool Execution Web Service Interface.

Location

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

Synopsis

opr-tool -help|-verbose|-example|<CONNECTION_INFO>|<toolRelatedOptions>

Options

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

This section shows a number of examples you can use as a starting point for developing your own opr-tool commands.

  • Return the list of applicable tools for a list of CIs:

    opr-tool -username user -password passwd -query -ci_list ci1, ci2
  • Return the list of applicable tools for a list of events:

    opr-tool -username user -password passwd -query -event_list event1, event2
  • Return the list of applicable tools for a list of nodes (specified by name):

    opr-tool -username -password passwd -query -node_list node.example.com
  • Get the list of parameters to be filled out for the tool with the specified id:

    opr-tool -username user -password passwd -get_user_parameters -id toolid
  • Get the list of parameters to be filled out for the tool with the specified name:

    opr-tool -username user -password passwd -get_user_parameters -name toolname
  • Run a tool on a set of CIs:

    opr-tool -username user -password passwd -run -id toolid -ci_list ci1, ci2
  • Run a tool on a set of nodes:

    opr-tool -username user -password passwd -run -id toolid -node_list examplenode1, examplenode2
  • Run a tool with user parameters on a set of CIs:

    opr-tool -username user -password passwd -run -id toolid -ci_list exampleci1, exampleci2 -parameters param1=value1, param2=value2
  • Run a tool with user parameters on all CIs from a view:

    opr-tool -username user -password passwd -run -id toolid -view_name exampleViewName -parameters param1=value1, param2=value2
  • Run a tool with user parameters on the node on which the related CI of the event is hosted:

    opr-tool -username user -password passwd -run -id toolid -event_list exampleEvent -event_node -parameters param1=value1, param2=value2