Skip to Content
avatar image
Former Member

Trigger an alert when XS job fails

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

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

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 24, 2017 at 03:08 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 24, 2017 at 03:26 PM

    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

    Add comment
    10|10000 characters needed characters exceeded