Regarding Autosys job alerts

Hi Experts,

I need my autosys job to send an email alert when java batch file configured to it end up with errorS. Unfortunately though my job is failing with error in log file autosys status is success and we are not getting any alerts. Please help me to figure out this.

@UnixNerd , Welcome, can you share the code of your autosys job and logfile checking , we'll have a chance of giving a reasoned response ththks

Thanks for the reply munkerholler, Cant share the code as it is illegal for me share the code. but I can say this is normal jdbc code to connect to a DB. and we have given a wrong password in config file to see if autosys fails with status failed. but it is not happening.

@UnixNerd , if you can't supply anything then my best guess is that there's

  • a missing condition the autosys job (alarm_if_fail: 0 ) ,
  • a log file is not created - perhaps permissions have changed into where they are written
    or
  • a bug in the script/job that checks the log file for errors and resulting in no failure condition being met hence no alerting.
  • check & verify that the alerting mechanism is working
  • are there other jobs failing that are sending alerts etc,
  • has there been any s/ware upgrades, job permission changes ...
    ....

try creating a job that is guaranteed to fail and sends an alert (alarm_if_fail:1 #is set)
enter a non existing command to be executed 'command: xxx'

NB: I don't have access to autosys , not used it for +15yrs so definitely any advice given needs testing/verifying/... etc

Hi MunkeHoller,
Below is the jil im using,

insert_job: JobName    job_type: cmd
description: description
machine: XXXXXXXX
condition: s(Previousjob)
owner: XXXXXXXXX
box_name: Box name
application: XXX
permission: gx,wx,ge
alarm_if_fail: y
alarm_if_terminated: y
profile: /home/admin/.profile
send_notification: y
notification_template: Email_notification
notification_emailaddress: XXX@XXX.com
std_out_file: XXX.log
std_err_file: XXX.log
command: XXXXXXXX.sh

@UnixNerd , I see you've asked on at least 1 other forum ( the forum rules request no cross posting Simple rules of the UNIX.COM forums: )

that aside, but with the dialog in the stackoverflow request, it appears that command: XXXXXXXX.sh is exiting with a 0 (success) status.
this needs to exit with a non-zero status for the alarm_if_fail: y
condition to be met such that an alarm is thrown.

you need to fix the check in your script that detects an error in the logs such that XXXXXXXX.sh exits with a non zero status.

I will not respond further whilst you have the stackoverflow request open

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.