Steps to setup and execute Python scripts on AWA
search cancel

Steps to setup and execute Python scripts on AWA

book

Article ID: 279724

calendar_today

Updated On: 07-16-2024

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Step-by step guidance on how to setup Windows and Unix agent to execute Python script via AWI.

Environment

Release : 21.x

Component : CA Automic Workload Automation - Automation Engine

Resolution

In client 0, add a line to the variable UC_EXT_INTERPRETERS_UNIX for Unix agent and UC_EXT_INTERPRETERS_WINDOWS for Windows agent in folder DIV_VARIABLES:

Key = PYTHON
Value 1 = .py
Value 2 = /usr/bin/python <FILE>

Option 1 - executing Python scrip on your local server 

  • Create either a Windows or Unix Job
  • On the pre-process tab add the following

:BEGIN_EXT_INT Python 

python -file C:\Automic/test.py 

:END_EXT_INT

Option 2 - executing Python scrip in the AWI  

  • Create either a Windows or Unix Job
  • On the pre-process tab add the following

:BEGIN_EXT_INT PYTHON 

# This program adds two numbers

num1 = 1.5 num2 = 6.3 

# Add two numbers 

sum = num1 + num2 

# Display the sum print('The sum of {0} and {1} is {2}'.format(num1, num2, sum)) 

:END_EXT_INT