How to enter several commands through CA Workload Automation DE CLI?

Document ID : KB000017412
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

The CA Workload Automation DE CLI allows user to perform several tasks. Executing one command at a time takes very long. Even if one session is kept open, the user has to type or 'copy and paste' one entry at a time. This can be error prone and can take hours if there are several hundred such commands that need to be entered.

Solution:

When using the CLI from a command line, the user can enter several commands in the same session. The CLI can be used in a script that will allow quick processing of several commands. Here is an example script for the cli (e.g. save it as my_cli.sh), with predefined input values to login to the CA WA DE server. User may modify it to suit their environment and OS

#!/bin/bash
#Define path to cli, hostname, port, user, and password
CLI=/opt/CA/DE/bin/cli
HOST=my-de-server
PORT=9600
USER=USER
PASS=0X1DC2ABDED00AAADD87ED8F537738828
#use ENCRYPTPASSWORD command to encrypt the password

$CLI $HOST $PORT $USER $PASS

#EOF my_cli.sh

Next create a file with commands that need to be defined, such executing an event or listing an application. Run 'help' from cli to get all the possible commands.

Here is a sample text file with a few commands (e.g. save it as cli_commands.txt).

Note: Commands are not case-sensitive.

about
dbinfo
uptime
listapplication

Run this from the command prompt

my_cli.sh <cli_commands.txt

All the commands from text file (cli_commands.txt) will get executed in the same session. This allows quicker execution.