cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger an alert when XS job fails

0 Kudos

We have a procedure in HANA and an XS job that triggers Procedure on every day,

We Need your help to check whether there is any Alert mechanism I.e. sending an email when the job fails.

Any setting in XS application or any procedure that checks the JOB_LOG table and send an email when it finds a failure status for the job. Thank you in Advance.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

We are using try catch block to catch any errors and send a email out.

//catch exception catch (e) { //get error message code = e.message; //set body var output = 'Job failed'; //send email var mail = new $.net.Mail({ //Sender Address sender: {address: "sender address"}, to: [{name: "TEST_NAME", address: "test@test.com", nameEncoding: "US-ASCII"}], subject: "Job Failed", subjectEncoding: "UTF-8", parts: [ new $.net.Mail.Part({ type: $.net.Mail.Part.TYPE_TEXT, text: output + 'With Error ' + code, contentType: "text/html", encoding: "UTF-8" })] }); mail.send(); }

Thanks

Srini

Answers (2)

Answers (2)

0 Kudos

We are using try catch block to catch any errors and send a email out.

//catch exception catch (e) { //get error message code = e.message; //set body var output = 'Job failed'; //send email var mail = new $.net.Mail({ //Sender Address sender: {address: "sender address"}, to: [{name: "TEST_NAME", address: "test@test.com", nameEncoding: "US-ASCII"}], subject: "Job Failed", subjectEncoding: "UTF-8", parts: [ new $.net.Mail.Part({ type: $.net.Mail.Part.TYPE_TEXT, text: output + 'With Error ' + code, contentType: "text/html", encoding: "UTF-8" })] }); mail.send(); }

Thanks

Srini

Former Member
0 Kudos

Hi Srini,

Did you figure out teh way to achieve this? We have similar requirement to generate emails whenever teh XS Job fails or succeeds.
Let us know if you can help us achieve the same.

Regards
Debanshu