Command Line Interface Reference
From OpsWise Documentation Wiki
Contents |
Introduction
The command-line interface allows you to remotely enter commands or execute scripts that display information or take action on your OpsWise operations. The command-line interface was first introduced in the Winter 2010 release of Automation Center (version 1.5) and no similar functionality existed in previous versions of the product.
Click here for special instructions about using the command line interface in z/OS.
Command line parameters are not case sensitive. If you do not supply all the required components of a command, you will be prompted for the missing elements.
When searching for record names that include embedded spaces, such as a trigger called "Every Hour" replace each space with a period (.)
The command-line interface module is included with the outboard components. In order to execute the commands, you must add this path to your path command or execute them from this directory:
/[outboard home directory]/bin
Required Parameters
Because you will be executing these commands and/or scripts from remote locations, you must provide the following information:
- IP address or DNS name where the OpsWise message transporter is running
- IP address or DNS name where the OpsWise core processor is running
- Login ID and password for OpsWise with the appropriate rights
Several methods are available for providing the required information:
- Using the
-c <filename>command switch to pass the values into the command from a file - Using command parameters
- Using environment variables
| Config File | Command Switch | Variable | Description |
|---|---|---|---|
| network.transports | -t tspname=<transporter> | TSPNAME | Port number @ machine name (host name of IP address) where the OpsWise transporter is running. You can view this information from the browser interface as follows:
|
| network.core | -n msghubname=<hubname> | CORENAME | Queue name for the message hub. You can view this information from the browser interface as follows:
|
| security.userid | -u userID=<userid> | User ID that the CLI utility will use to log into OpsWise. Must be a valid user with the appropriate permissions defined in the OpsWise database using the OpsWise Security module. | |
| security.password | -p password=<password> | Password that the CLI utility will use to log into OpsWise. Must be a valid password for this user. |
Each is described further below.
Using the Configuration File Method
Shown below is the command syntax if you use a configuration file to pass the required information into your script or command:
[command] -c <filename> [command parameters]
The configuration file can have any name. Shown below are the required parameters and sample values of a configuration file:
network.transports=6803@localhost network.core=HUB01 security.userid=ops.admin security.password=o
Using Command Parameters
Shown below is the syntax with sample values if you choose to provide the required information using command parameters:
-t tspname=6803@localhost -n msnhubname=HUB01 -p password -u userID
Using Environment Variables
You can set the following environment variables to set the core and transporter names:
TSPNAME CORENAME
Optional Parameters
| Optional Parameter | Description |
|---|---|
| -v | If you are executing commands that fetch data for display on the command line, you can optionally choose to use the verbose command, which provides additional information. |
| -o | Timeout. |
Return Codes
Shown below are return codes you may get in response to your command:
| Return Code | Description |
|---|---|
| 0 | Completed successfully. |
| 1 | Configuration error (incorrect command line or configuration file options) |
| 2 | Not enough memory. |
Table of Commands
The following table provides a quick reference for all supported commands, including command syntax and description.
| Command Syntax | Description |
|---|---|
ops-agent-status [agent-name=, agent-type=, options=] | Lists the status of one or more agents. Command switches:
Example: ops-agent-status -c config.txt agent-type=windows |
ops-export-bulk [none] | Performs a bulk export of all records in your OpsWise database. This command creates a separate XML file for each record type in the following directory:\$tomcat dir$\webapps\opswise\WEB-INF\plugins\com.opswise\backup\unload Example: ops-export-bulk -c config.txt |
ops-import-bulk [none] | Imports into your OpsWise database the contents of the following directory:\$tomcat dir$\webapps\opswise\WEB-INF\plugins\com.opswise\backup\unload The data being imported must have been exported using the ops-export-bulk command. Example: ops-import-bulk -c config.txt |
ops-export-trigger [trigger-type= trigger-name=] | Performs an export of the specified trigger(s) and all the associated record(s). For example, if you export one trigger, the utility also exports the calendar used in the trigger and all tasks launched by the trigger. The utility creates a separate XML file for each record type and generates the output directory and filenames using a date and timestamp, plus an internal record identifer generated by the system. The exported directory and its data is created in the following directory:\$tomcat dir$\opswise_export\ Shown below is a sample output directory and exported data:
Wildcards supported. Command switches:
The following example exports all triggers whose name begins with "SF": ops-export-trigger -c c.cfg trigger-name=SF.* |
ops-import-trigger [import-file=] | Performs an import into your OpsWise database the trigger records contained in the specified file. Command switches:
\$tomcat dir$\webapps\opswise\WEB-INF\plugins\com.opswise\backup\unload |
ops-task-cancel [task-instance=] | Cancels the specified task instance(s). Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
|
ops-task-forcefinish [task-instance=] | Force finishes the specified task instance(s). Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
|
ops-task-skip [task-instance=] | Skips the specified task instance(s). Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
$ ./ops-task-skip -c c.cfg task-instance=90079026d861e5e400bba81913a4fdd0 |
ops-task-hold [task-instance=] | Places the specified task instance(s) on hold. Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
Example: $ ./ops-task-hold -c c.cfg task-instance=90079020d861e5e40128cbb3cdbe1cf3 |
ops-task-launch [task-name= task-variables=] |
Launches the specified task(s). Wildcards supported. Command switches:
task-variables={variable1=first value variable2=second value}
|
ops-task-release [task-instance=] | Releases the specified task instance(s) from hold. Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
$ ./ops-task-release -c c.cfg task-instance=90079020d861e5e40128cbb3cdbe1cf3 |
ops-task-rerun [task-instance=] | Reruns the specified task instance(s). Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
|
ops-task-setpriority [task-instance=, priority=] | For agent-based tasks (Windows, Linux/Unix, or z/OS) in a status of Started, changes the priority on the specified task instance(s). Wildcards supported. Click here for a description of behavior and restrictions. Command switches:
|
ops-task-status [task-name=, task-type=, options=] | Displays the status of all task instance(s) associated with the specified task. Wildcards supported. Command switches:
$ ./ops-task-status -c c.cfg task-name=mantask |
ops-trigger-enable [trigger-name=] | Enables the specified trigger(s). Wildcards supported. Command switches:
|
ops-trigger-disable [trigger-name=] |
Disables the specified trigger(s). Wildcards supported. Command switches:
|
ops-trigger-now [trigger-name= trigger-type trigger-variables] | Marks all conditions satisfied in the specified trigger(s) and launches its associated tasks. Wildcards supported. Command switches:
task-variables={variable1=first value variable2=second value}
|
ops-trigger-status [trigger-name=, trigger-type=, options=] | Lists the status of the specified trigger(s) -- satisfied or not satisfied. Wildcards supported. Command switches:
|
ops-variable-list [variable-name=, variable-scope=] |
Lists the specified variable(s). Wildcards supported. Command switches:
Example: $ ./ops-variable-list -c c.cfg variable-name=abc.* variable-scope=global |
ops-variable-set [variable-name=, variable-scope=, variable-value=, create=] |
Sets the specified variable(s). Wildcards supported. Command switches:
Example: $ ./ops-variable-set -c c.cfg variable-name=myvar1 variable-value=mydata1 create=y |
ops-manual-setcompleted |
For a Manual task, sets its status to Completed.
Example: $ ./ops-manual-setcompleted -c c.cfg task-instance=8fda93dcd861e5e4005bf48e2cad6206 |
ops-manual-setstarted |
For a Manual task, changes its status from Action Required to Started. This allows you to acknowledge the Manual task and indicate that the manual procedures have been started. Example: $ ./ops-manual-setstarted -c c.cfg task-instance=8fda93dcd861e5e4005bf48e2cad6206 |

