Alerting on an external Linux script's error return code

Discussion created by Malik_Abdul_8942 on Sep 12, 2017
Latest reply on Sep 13, 2017 by Wolfgang_Brueckler_1288

We have a job executing a Linux script on a RHEL 6x node and UC4 returns a successful code even if the script fails. Since it is only executing the script is there a way for Automation Engine to key off a return code from the script to alert if it fails? if not, what are other customers utilizing to monitor Linux/Unix script failures via Automation Engine? Any help/direction is much appreciated.


You have to throw error message in your script ( for example ) so it will be shown in the report and then you will postprocess the report in the Post-process page of the JOB. Here is an example which does just that. 

Please read this documentation page thoroughly. 

Docu snippet 

“The end of a job can still be influenced with post-script commands. The job return code and status text (the text supplied by the Job Messenger in the Trailer) can be modified subsequently, for example. The :MODIFY_STATE script statement, which was developed exclusively to be used on this page, defines the final ending of the job. 
For example, reports can be analyzed with PREP_PROCESS_REPORT. If an error is found, the ENDED_NOT_OK status could be defined for a job, although it has already ended normally a technical point of view and viceversa. The return code 0 is assigned to canceled jobs because the job being canceled is irrelevant for processing. 
With the :RSET script statement, script variables can be transferred between the Process and Post Process pages. This script statement returns the value which has been assigned to the script variable in the Process page.”