Unix Python Jobs
Unix Python Jobs let you run Python scripts on Unix environments where a Unix/linux Agent is installed. Unix Python Jobs can run independently or they can be added to a Job Group (JOBG), to a Workflow and to a Schedule. They can be executed on Unix Agents and on Agent Groups.
The Automic Automation / Python integration includes the Python dictionary with the Automic Automation variables that you can use in Python Jobs. This means that you can include Automic Automation variables using Python scripting just as you do with the AE scripting language. You just have to register the name and value of the variable on the Job's Process page first and you can then use it in your script; you use the :REGISTER_VARIABLE script function for this purpose. The integration lets you create your own variables too, and use them in Python Jobs. Using a specific script statement, you can also get a list of the all available variables. For more information about how to register variables and output files and about how to use Python scripting in Python Jobs, see Python Scripting.
Defining a Unix Python Job
A Unix Python Job definition is made up of the following pages:
- Standard pages that are always available, no matter what type of object you are defining:
- Additional pages that are always available for executable objects:
- The Unix Python page described here.
To Define the Unix Python Job
-
On the Attributes page, select the Windows Agent and the Login object with the credentials to access the Agent.
-
On any of the Process pages, write the script you want this Job to execute on the Agent. Use Python code only or a combination of Python and the Automation Engine scripting language. You can use script variables here.
For more information, see:
-
If necessary, specify additional attributes on any of the other definition pages.
-
In the Start Parameter section on the Python page do the following:
-
In Python Interpreter enter the Python interpreter that you are using. If you leave this file empty, the default python is used.
-
In Options you can specify parameters for the interpreter. For information about the available commands, see the official Python documentation at cmdline.html.
-
Specify the Working Directory in which the Python execution should take place.
-
In Requirements, you specify the list of Python packages (libraries, frameworks or other programs) that this Job requires to be able to execute. Write out each package. It is not necessary to specify their version. When this Job is executed, the Agent calls the Python package manager (PIP), which installs the specified packages (if not already installed).
After executing the Job, the Agent generates a dedicated report called PIP that contains the result of installing the specified packages. If any of them could not be installed, the Job cannot execute.
Important!
-
-
In the Job Report section, specify when to generate reports and where to store them. For more information, see Job Reports.
-
Save your changes.
Executing Unix Python Jobs
You can include the Unix Python Job in Schedules (JSCH)and thus be executed automatically at predefined dates or intervals. Likewise, they can be part of Workflows (JOBP). For more information, see Superordinate Tasks (Parents).
You can also execute them manually. The following topics describe the execution process in Automic Automation in general and the Job-specific characteristics:
Monitoring Unix Python Jobs
As soon as the Job is activated, it is available as task in the Process Monitoring perspective. In the Task list you can see its status. Right-click it to open its monitor (see Monitoring Jobs); it contains three pages that provide the most important information on the Job parameters. The Windows Python page shows the read-only Python-specific settings as defined in the Job and the resolved values if variables were used in the definition.
When processing Jobs, Automic Automation generates output files and reports that guarantee traceability and auditability. Have a look at the following topics to learn more about this:
From the list of tasks in the Process Monitoring perspective, you can access all the functions that are available to Job tasks, see Working with Tasks.
Automic Automation provides multiple tools to troubleshoot in case of failures, see:
See also Troubleshooting, Root-Cause Analysis and Remediation.
Analyzing the Last Execution of a Job with Gen AI
As a developer and object designer, after configuring an executable object, you execute it to make sure that it behaves as you expect. Every time that you execute the object, a runID is generated that identifies that execution. If the execution fails or if the outcome is not what you expect, you use the reports and Executions lists to investigate the reasons for the failure. Automic Automation's Gen AI simplifies this process substantially. You can open the Automation AI Assistant as follows:
-
From the Explorer list in the Process Assembly perspective, right-click the object and select Monitoring > Analyze Last Execution.
-
On the object-specific definition page, click the Analyze Last Execution button.
Automic Automation's Gen AI crawls all the reports and logs available for the last execution of the object, it summarizes what happened, analyzes the automation outcome and provides suggestions to solve any existing or potential issues. It also provides a link to the execution itself in the list of Executions (Process Monitoring) and to the report. You can start a conversation in the Ask Automation AI Assistant field at the bottom of the pane.
For more information, see: