search cancel

Trying to create job to capture and email the night before' s demon log

book

Article ID: 254313

calendar_today

Updated On:

Products

CA Workload Automation AE

Issue/Introduction

I am trying to set up a job that will automatically capture the night before's demon log and send it to a specific folder so we have a history of it before it rolls off in 7 days and I am receiving the below error.

CAUAJM_E_50135 Only Administrators or Power Users can execute autosyslog.

Here is the new jobs JIL I set up this morning.

insert_job: aa-scheduling_ep_log_qa    job_type: cmd
description: Capture EP log from midnight to now
machine: azeantts518
owner: [email protected]
permission: gx,wx
alarm_if_fail: y
alarm_if_terminated: y
send_notification: n
std_out_file: "C:\temp\Scheduling_EP_Log_qa.txt"
std_err_file: "C:\temp\Scheduling_EP_Log_qa_err"
command: autosyslog -e event_demon.TST

Environment

Autosys 12.0

Cause

The user listed in the job was not part of the local administrators' group

Resolution

The error you are getting:
CAUAJM_E_50135 Only Administrators or Power Users can execute autosyslog.

means that the user on the job:
owner: [email protected]


in not part of the Administrator or power users security groups.
The autosyslog command does require elevated permissions to run.

If you log into your windows server and open an Autosys prompt with out running as administrator you will get the same error.

You can see the below KB article on this.
https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=118605

You will want to make sure you have the environment for the user properly setup for autosys as well.

Once you correct the local windows permissions you should be able to run the job without an error.

Additional Information

As your use case is to simply copy the event_demon log to another location I suggested using a simple script.

below is an example of a simple script only:

@ECHO ON
SETLOCAL

set AUTOSERV=AF1
set CUR_YYYY=%date:~10,4%
set CUR_MM=%date:~4,2%
set CUR_DD=%date:~7,2%

SET LogFile=event_demon.%AUTOSERV%

SET SourceDir=C:\Program Files\CA\WorkloadAutomationAE\autouser.%AUTOSERV%\out\%LogFile%
SET TargetDir=C:\Targetpath\event_demon.%AUTOSERV%.%CUR_MM%%CUR_DD%%CUR_YYYY%


COPY "%SourceDir%" "%TargetDir%
pause

 

The above would copy the current day's event log to a target directory and append the current date to it.
if you run this at 11:59 PM This should accomplish what you are looking to do.

If you would like to run it after midnight and capture the precious day's logs this require a great deal more logic in the batch file to handle cross month and years.

Creating custom scripts of this nature are outside the scope of support.