AutoSys Workload Automation

 View Only
Expand all | Collapse all

Regarding Job Logs / std_err_file

  • 1.  Regarding Job Logs / std_err_file

    Posted Sep 01, 2015 05:24 PM

    we have autosys jobs defined in our envt, however in WCC when we are trying to see the JOB LOGS (STD output, agent log and Error logs) under Job RUN in Quick View, it is not displaying any error logs, even after the job is getting failed and script is through error or even a simple echo "fail".

     

    i have defined the following:

     

    std_out_file: /tmp/test/job_output.txt

    std_err_file: /tmp/test/job_error.txt


    on success of job, i can see the logs under standard output file in WCC or on machine level but for failure i am not seeing the logs. also i am not getting any error msg its just blank error output console.


    For output and agent logs i am seeing the full details.

     

    SO how can i see the error logs in WCC?


    Other requirement wrt to logs is:


    user wants to have log file created as job_name_Job_executing_datetime_output.txt and error.txt

    eg: JOb ABC running at 2nd Sept, 2015 at 11AM, will create log files like... ABC_09/02/2015/11:00_output.txt and ABC_09/02/2015/11:00_error.txt



  • 2.  Re: Regarding Job Logs / std_err_file

    Posted Sep 01, 2015 05:29 PM

    sunish,

     

    are these command job types?

    if so what ommans are running? is it possible they do not print to stdout/error?

     

     

    Steve C.



  • 3.  Re: Regarding Job Logs / std_err_file

    Posted Sep 01, 2015 05:34 PM

    I tried with script as well

     

    Like

     

    Echo fail; exit 2 or application teams have given some testing scripts to see if job failures logs can be fetched or not .

     

    But no luck… ☹ For STD_output, I can see the script output by app team.



  • 4.  Re: Regarding Job Logs / std_err_file

    Posted Sep 01, 2015 05:39 PM

    so you see it.. there will not be a stderr if you use echo. echo writes to stdout.

    you need to direct to stderr..

    Please test step by step and make sure you use proper code etc.

    command: echo "test"

    std_out_file: /path/$AUTO_JOB_NAME.$AUTOTRUN

    std_err_file: /path/$AUTO_JOB_NAME.$AUTOTRUN

     

    replace path with a proper path.

    also make sure the path exists and you are allowed to write to it..

    autorep -J job -d will tell you if you were able to open stdout and stderr. like always in autosys..

     

    Also you have to make sure that the WCC eem policy allows you to access the logs.

    Other than that, it appears , your team has a bit of a learning curve ..

     

    Hope this helps.

     

    Steve C.



  • 5.  Re: Regarding Job Logs / std_err_file
    Best Answer

    Posted Sep 01, 2015 07:39 PM

    @Sunish: As SteveC said, echo writes to stdout. Try with an invalid command. If you are using scripts, ensure the script does not have a `exec 2>&1` coded.



  • 6.  Re: Regarding Job Logs / std_err_file

    Posted Sep 02, 2015 05:31 AM

    Thanks Chandru for suggesting a way to check the error logs by suggesting to give a wrong command. Its working and I can see the logs from WCC.

     

    This is the steps that I need to follow going forward:

     

     

    1.       Create a job with std_out and std_err attribute with the path where the script or command output / error will be redirected.

     

    However, I have 1 more question or clarity, why cant we fetch the logs in WCC from deafult location whenever the job is executing.

     

    As per my understanding, whenever a job gets executed, it must be writing logs in default location or not? If yes, then why we cant read logs from WCC from that default location.



  • 7.  Re: Regarding Job Logs / std_err_file

    Posted Sep 02, 2015 07:54 AM

    default location is /dev/null always has .. always will.. for any system..

    if you don't include the path it will be the $HOME of the user id on the machine run. just like on any scheduler or system.

    There are times when $HOME may not be set and then its root and you wont be able to create a file on the root directory ..



  • 8.  Re: Regarding Job Logs / std_err_file

    Posted Sep 02, 2015 06:16 AM

    Adding 1 more clarification:

     

    Std_out or std_err attribute will display or capture logs wrt script or command executions (application logs), if we have some network issues, machine issues or wrong user id/password issues then it wont capture that in std_err file. Is there a way by which we can capture those failures or logs as well in std_err_file.

     

    Eg: I updated the job with wrong owner id and before updating the final FAILURE STATUS, it restarted the job 10 times with the logs saying “Owner attribute error. User doesn’t exist in system” but it is not reflecting in WCC, infact in the JOB RUNS, that occurance doesn’t show up in WCC.

     

    Below are the snapshots:

    I forcestarted the job at 04:51, it failed after 10 restarts at 04:58, but in WCC under JOB RUNS this occurance is not showing and only displaying the last attempt which is 04:49.

     

     

     



  • 9.  Re: Regarding Job Logs / std_err_file

    Posted Sep 02, 2015 07:52 AM

    HMMM and here  i thought i suggested using proper error logic. interesting.. ..

     

    if the job is failing with wrong owner. then it never will write to the std log files as it failed before issuing the command.

    (system restart) it will NOT show the attempt in the form of a std log file. but look for spool file perhaps.

    since the job didn't actually RUN you won't see that as well

    If there's no start and no real end. its a system message and only visible in the detail..

    Good luck ..



  • 10.  Re: Regarding Job Logs / std_err_file

    Posted Mar 01, 2016 06:16 AM

    @ Steve, we're running a job and its getting success state, unfortunately we are still getting some std_err_out details such as below. Any idea why this is being thrown on it?

     

    ndmcli  -x << EOJ

    submit proc1    process    snode=$3

           step1    copy from  (file=$1 pnode)

    @@     to    (file=$2)

           pend;

           quit;

    EOJ



  • 11.  Re: Regarding Job Logs / std_err_file

    Posted Mar 03, 2016 12:59 AM

    Jehan,

     

    My understanding is this could be something in the script / command that you are executing is complaining about even though the Jobs returns successful.

    Also execute command string directly on to the Agent CLI to check if it still returns the identical error message reported in the STD_ERR_FILE?

    - Review the scrip / command you are executing with the team who created it; could be as simple as a permission problem



  • 12.  Re: Regarding Job Logs / std_err_file

    Posted Mar 03, 2016 06:53 AM

    some commands write to std_err. if you have different file names for it

    that could be why you see it.

     

    Steve C.

    Stirling Systems Group