Automation Center Documentation

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:
  1. From the navigation pane, select Automation Center Resources > Connectors.
  2. Locate the transporter that was specified in the network configuration for this agent. Click on the transporter name to display its details. Among the details provided on this screen are the Host Name, IP Address, and Port for the transporter. Use the format port@host to provide this information. Example:
    6803@localhost
network.core -n msghubname=<hubname> CORENAME Queue name for the message hub. You can view this information from the browser interface as follows:
  1. From the navigation pane, select Automation Center Resources > Connectors.
  2. Locate the QUEUE NAME for the message hub. The default is HUB01.
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:
  • agent-name = The host name of the machine where the agent is running.
  • agent-type = One of the following: WINDOWS, UNIX, LINUX, LINUX/UNIX, ZOS or Z/OS.
  • options= -v

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: file:sample trigger output.gif

Wildcards supported. Command switches:

  • trigger-name = All or a portion of a string, which may or may not select one or more triggers.

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:
  • import-file=The filename created when you ran the export-trigger command. The file name is created automatically. You must supply the filename but the command is hardcoded to look in the following directory:
\$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-name = Required. A valid task name.
  • task-variables = Optional. Any variables specified in the task that need a value to run properly. All variable=value pairs must be specified within one set of curly braces, as shown in this example:
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:
  • task-instance= An internal OpsWise identifier, or all or a portion of a string, which may or may not select one or more task instances.
  • priority= One of the following: high|medium|low
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:
  • task-name = All or a portion of a string representing one or more task names, which may or may not select one or more task instances.
  • task-type = One of the following: SLEEP, WNDOWS, UNIX, ZOS, FILE_MONITOR, MANUAL, EMAIL, FTP, SQL, FTP_FILE_MONITOR, TASK_MONITOR, STORED_PROCEDURE, SNMP.
  • options= -v


Example:

$ ./ops-task-status -c c.cfg task-name=mantask
ops-trigger-enable [trigger-name=] 
Enables the specified trigger(s). Wildcards supported. Command switches:
  • trigger-name = All or a portion of a string, which may or may not select one or more triggers.
ops-trigger-disable [trigger-name=] 

Disables the specified trigger(s). Wildcards supported. Command switches:

  • trigger-name = All or a portion of a string, which may or may not select one or more triggers.
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:
  • trigger-name = Required. All or a portion of a string, which may or may not select one or more triggers.
  • trigger-type = Optional. If you used a wildcard in the trigger-name parameter, you can use this parameter to narrow down the selection to a specific type of trigger. Allowable values are:
    • cron
    • time
    • temporary
    • manual
    • file
    • task monitor
    • application monitor
  • task-variables = Optional. Any variables specified in the task that need a value to run properly. All variable=value pairs must be specified within one set of curly braces, as shown in this example:
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:
  • trigger-name = All or a portion of a string, which may or may not select one or more triggers.
  • trigger-type = One of the following: CRON, TIME, FILE_MONITOR, TEMP, TASK_MONITOR.
ops-variable-list [variable-name=, 
variable-scope=] 

Lists the specified variable(s). Wildcards supported. Command switches:

  • variable-name = All or a portion of a string, which may or may not select one or more variables.
  • variable-scope = One of the following: SELF, PARENT, TOP_LEVEL_PARENT. Click here for a description of each.

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:

  • variable-name = All or a portion of a string, which may or may not select one or more variables.
  • variable-value = A string that will become the value of the selected variable(s). UTF-8 character set supported.
  • variable-scope = global or local. A global variable is created independently by selecting Variables from the OpsWise navigation pane. A local variable is attached to a trigger or task. See User-Defined Variables for more details.
  • create = [yes | no]. A switch indicating whether or not a new variable may be created for this request.

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
Personal tools