How to set up alert mechanisms based on the DS logs
Moderators: chulett, rschirm, roy
How to set up alert mechanisms based on the DS logs
Hi
ANy idea how do we set up alert mechanisms using DS Logs. I want to put an alert set up if i see a particular message in the Log and send out an email?
thanks
Pavan
ANy idea how do we set up alert mechanisms using DS Logs. I want to put an alert set up if i see a particular message in the Log and send out an email?
thanks
Pavan
pavan
Re: How to set up alert mechanisms based on the DS logs
You can do such kind of processing in a job sequence where through basic routines you can look for whatever message you are looking for in the job's log and send notifications.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
capturing part of Log masg
How can I capture the status of job from job Log(basically a part of log msg like 'no of recorded inserted in table') and send it as subject of mail notification in DS sequence stage,using routine (BASIC/C code)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage will never report "number of records inserted in table". DataStage reports "number of rows sent to table" - whether or not they are successfully inserted depends upon the database server. If it generates error messages, these are returned to DataStage and logged. Thus, if you want to calculate "number of records inserted" you need to do some log browsing and some arithmetic.
But, yes, it can all be done with the DataStage API functions.
But, yes, it can all be done with the DataStage API functions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
Re: capturing part of Log masg
You are mixing terminology up, I think - job status is very different to the row count. There are DS Basic functions that return various information about a job given the name. Here is my Routine for job status:Roopanwita wrote:How can I capture the status of job from job Log(basically a part of log msg like 'no of recorded inserted in table') and send it as subject of mail notification in DS sequence stage,using routine (BASIC/C code)
Arguments: JobName, InfoID
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = 0
handleJob = DSAttachJob(JobName, DSJ.ERRNONE)
If NOT(handleJob) Then
Ans = -99
End
Else
Ans = DSGetJobInfo(handleJob, InfoID)
End
DetachResult = DSDetachJob(handleJob)
and my Routine for link count:
Arguments: JobName, StageName, LinkName
$INCLUDE DSINCLUDE JOBCONTROL.H
Ans = 0
handleJob = DSAttachJob(JobName, DSJ.ERRNONE)
If NOT(handleJob) Then
Ans = -99
End
Else
Ans = DSGetLinkInfo (handleJob, StageName, LinkName, DSJ.LINKROWCOUNT)
End
DetachResult = DSDetachJob(handleJob)
The Link Count routine needs to be passed the job name, and the name of an active stage and link. Active stages in a Server job would be Transformer, Sort, etc., but not Sequential File for instance. So you need to know the job design to get the row count info through this route - it doesn't use the Job Log, and you can only get info about the latest run.
InfoID can be passed such as DSJ.JOBSTATUS, DSJ.JOBSTARTTIMESTAMP, DSJ.JOBLASTTIMESTAMP, DSJ.JOBELAPSED.
I'm sure the gurus will correct me if this information is not applicable or different for PX jobs.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant
-
- Participant
- Posts: 125
- Joined: Mon Sep 11, 2006 4:22 am
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Hi,Roopanwita wrote:Sorry for miscommunication.
Actully i wanted to capture part of msg Log ,i'e no of records procrssed..
if there is any fatal error in job,then from Log want to capture error msg line.
Thanks
You can also get the above result from "dsjob" commands.
For the number of records you can use :
Code: Select all
$DSHOME/bin/dsjob -report project_name job_name DETAIL
Code: Select all
$DSHOME/bin/dsjob -lognewest project_name job_name FATAL
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)