Skip to Content
0

Trigger an alert when XS job fails

Jul 06, 2017 at 05:17 PM

77

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Aug 22, 2017 at 02:41 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 24, 2017 at 03:08 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 24, 2017 at 03:26 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded