cancel
Showing results for 
Search instead for 
Did you mean: 

BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?

Former Member
0 Kudos

Hi All.

I have this request.

BODS 3.1 : How to trigger an email alert for the jobs on BODS server ?

We have jobs scheduled on BODS running smoothly and absolutely fine.

But to check, i am logging into the admin console and check for the jobs status.

I would like to have an email to be received from BODS after each job is finished.

It could succuessful. Or it could fail.

Whatsoever, i wish to receive an email alert as soon as a job is finished.

Can anyone advise me as to whether this could be made possible.

And if yes, how this could be done.

Thanks for your help in advance.

In BOE CMC / for webi / schedule / we find an option to send email for a job success or a job failure.

Is there any option similar to that in BODS ?

Also would like to know :

how to use the smtp_to or mail_to functions ?

how to set up the smtp server for this ?

thanks

REgards

indu

Edited by: Indumathy Narayanan on May 31, 2011 3:47 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hi All,

Anybody tried to send an attachment along with email notification.

For example: If the rejected records has to be send to the data owner as an attachment.

Is this can achieved in BODS.

Appreciate your feedback.

Thanks & Regards,

Neel

Former Member
0 Kudos

thanks

Former Member
0 Kudos

Can anyone advise on this please. thansk

Former Member
0 Kudos

Use Try - catch for your Job and in the catch block you can have error message and mail notification when error.

and in the regular Job flow have SUccess mail script.

Former Member
0 Kudos

Hi thanks.

I shall check on using try and catch. I have to figure out how to use it in the existing jobs.

Rather do we have a simple way to display the last line of the trace log and to display the last line of the error log ?

What am i really looking for is a simple way on the smtp_to function itself

which has anyhow 5 parameters

and last 2 parameters are mandatory

for trace log no of lines

and error log no of lines to display.

And if i say 10, 10

- it gives the 1st ten lines, of trace and logs.

That is fine.

Am not familiar much with any scripting, though i will try to figure out.

But want to know, if this can be achieved.

Because all i want to know is what is the end line saying.

And where it has finished and where it has terminated - on the notification.

Or the only way is to use option of try and catch.

Thanks

indu

================

.. I think my logic is not correct on the above lines.

How will the system know which is the last line.

Shall check the try and catch and sort this out.

thanks

Edited by: Indumathy Narayanan on Jun 8, 2011 5:14 PM

Former Member
0 Kudos

Dear Indumathy,

The mail_to and smtp_to are in fact the functions you should be looking for when you want to send e-mail.


mail_to('<email address>', 'test', 'test', 10, 10);

You need to configure SMTP in the Data Services Server Manager - please look for 'To define and enable the smtp_to function' in the SAP BODS Reference Guide. The procedure is different with Windows and Unix. Depending on the environment you need a MAPI or mailx compliant client. You also need to setup the environment that you are not prompted for a password, otherwise it fails.

You either need to setup an account that can be used without password on an smtp server or you need to make sure the authentication is done for the user that runs BODS. As it does not seem to be possible to set up a secure connection, you also might need to see that you are able to access port 25 on the mail server from the machine where your job server is running.

Former Member
0 Kudos

Hi Christian

Good morning. And Many thanks for your response.

Am new to this BODS and configuration and setups and hence trying to look around for information.

A few more things if you could help me understand please :

1) When i looked at the Reference Guide. It just says put the ip address of the SMTP server. Which i have added.

And sender address email. Which we have bodsjobs@mycompany,com which have included.

But i think we need to open up the port 25 ?? for smtp ?

Because telenet servername 25 : says service is not available.

2) Also not understanding the screen of Data SErvices SErver Manager :

Peer to Peer options : Start port : 1025 end port 32767.

What are these referring to ?

And at command prompt :

When i say netstat -an|find "25"

it returns

TCP 0.0.0.0:1025 0.0.0.0:0 LISTENING

Thanks

indu

Former Member
0 Kudos

For 1)

You need to get in touch with the person(s) running the SMTP server and/or the network you are running. Not having access to port 25 can be blocked on the machine itself or be a general rule for certain subnets or hosts. Depending on the setup you might even setup your own mail server to simplify things (e.g. an open source solution like James) that you just use for that purpose.

For 2)

The peer to peer ports are referring to the ports the software may use to communicate from one flow to the other or to a sub flow and back.

Former Member
0 Kudos

Thanks Christian, for the response and for your time.

Shall update this post after i complete this.

Regards

indu.

Former Member
0 Kudos

Hi.

Since am new to this BODS. I need some help.

I already have many jobs which are running absolutely fine.

And when a job runs, and finishes, am able to see the trace saying

e.g. :

Job_abc is completed successfully.

We got the smtp service activated for our test server.

and we hae a group email id.

I have put the details of the smtp server / ip address / and said apply restarted.

The i created a simple test script as below :

print (' Before email ' );

smtp_to('abc@company_name.com', 'Job ' || job_name() ||' on ' || host_name() || ' has FAILED',

' the job has failed', 0, 0);

print('After Email ');

It does send a email to as per smtp_to whatever email is specified.

But how to differentiate between a job success

And a job which has failed.

I wish to have a mail which says on the subject :

'Job ' || job_name() ||' on ' || host_name() || ' has completed successfully'

==> IF it is a success

OR

'Job ' || job_name() ||' on ' || host_name() || ' has failed'

==> if it has failed

How to make the system identify, whether

to send a success message or a error message whatever

Could anyone advise.

thanks

indu