Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jitu2110
Creator
Creator

Job Failed Email Alert in QMC

Hi All,

i have created a vb script Job which run throw External Program in QMC.

we have also configured Mail Server in QMC and the TEST mail is also able to send a Test Email ( that means email Server is configured successfully)

Now, my mail work is that when my vb script job execution get failed, i want to send a job failure email.

Kindly let me know how to configure that after the job one customized email send to an email id.

Thanks in Advance

6 Replies
marcus_sommer

I think you will need an additionally routine which checked if your vbs-routine was successful or failed. I could imagine that you implement the writing of parameters in a text-file within your vbs-routine, for example:

start     2017/06/07 15:19

at the beginning and by finishing something like

end     2017/06/07 15:20

Another routine, for example a normal qlikview-load triggered within the qmc read this file and if it not exists or matched not to your requirements you let the reload fail and you will get a mail of the failing.

- Marcus

jitu2110
Creator
Creator
Author

Thanks Marcus.

But did you not think this is very complicated process to do, if vb script Job's  failed or Success is successfully understand by QMC then why not this features should be inbuilt there. like on job successful send this email and on job fail send that email in External Task Wizard only. 🙂

marcus_sommer

If you triggerred an (from a qmc point of view) external (vbs) job how could the qmc know if this task was successful or failed? AFAIK there is a message-system within the OS which tools could use to exchange informations like a status but I doubt that it would be trivial to use even if all involved parts would support this feature.

This meant you will always need additional steps to communicate it back to the qmc like the described workaround above or you creates in some other way. A quite "classic" way would be to implement an appropriate error-handling within the vbs-routine so that they itself couldn't fail only the some tasks within it may not successful - and then send your message from the vbs-routine.

- Marcus

jitu2110
Creator
Creator
Author

Hi Marcus,

when we run the Job from QMC is have small icon which indicate job/reload failed and successful status.

Yes you are right i am doing a custom error handling in the code itself.

QMC is able to send failed emails if Job/reload is failed. Now i am working how to send an email when Job/reload is successful.

jitu2110
Creator
Creator
Author

if you have any idea how to send reload successful email via QMC kindly let me know, the successful email right now i am able to send via distribution features which i think is not right because attachment is also going with it which i do not want if the link is going than its okay

marcus_sommer

AFAIK there is no inbuilt feature for sending an email when a task was successful. But you could do some workarounds.

One would be to chain another task to each of your tasks and if they are successful they will trigger those dummy-tasks which doesn't do anything except to fail and their error-message per email mean that the task before was successful. But this will be a quit ugly way to get this kind of information and it will need some attention to differ between the false positive ones and the really failed tasks.

Therefore I think it would be better to implement an EXECUTE statement on the very end of each of your tasks which triggerred a vbs-batch which will send the email. This could be outsourced within an include-variable and/or a sub-routine to avoid any cluttering of the script and could contain a small parameter-store in a file of the qvw- or the task-name to differ the various tasks (the vbs needs to read this parameter). Here an example what is meant:

Re: Stop Task from Command Line (cmd.exe)

- Marcus