Jobs Status Report
Moderators: chulett, rschirm, roy
Jobs Status Report
Hi,
I would like to generate a report daily in such a way that, it should contain
the below details:
Job name, Current status (Aborted or finished ), Last runtime.
It should contains only the jobs which ran in yesterday.
How to generate that report?
Please let me know, if anyone already implemented this!!
Thanks
I would like to generate a report daily in such a way that, it should contain
the below details:
Job name, Current status (Aborted or finished ), Last runtime.
It should contains only the jobs which ran in yesterday.
How to generate that report?
Please let me know, if anyone already implemented this!!
Thanks
pandeeswaran
Well... one of the standard answers you're going to get would be to download ETLStats from Kim Duke's website and tweak it to do whatever you like. I'll let you search the forum for information on that, if you like.
If that's literally all you need, seems to me you could script that using dsjob with the -jobinfo option. Use dsjob to get a list of jobs (or higher level a list of projects) and then iterate thru the list of projects / jobs and check each one by one. If it ran "yesterday" capture the status and runtime.
If that's literally all you need, seems to me you could script that using dsjob with the -jobinfo option. Use dsjob to get a list of jobs (or higher level a list of projects) and then iterate thru the list of projects / jobs and check each one by one. If it ran "yesterday" capture the status and runtime.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you enter the command dsjob with no arguments, it will display a list of available options at that level. You would discern from that, for example, that the option of a list of projects is -lprojects.
If you enter the command dsjob with a major argument, such as -run, but no other arguments, you will get a usage syntax for that option.
Over to you to conduct the research. An alternative is to read through the many pages on dsjob in the manual.
If you enter the command dsjob with a major argument, such as -run, but no other arguments, you will get a usage syntax for that option.
Over to you to conduct the research. An alternative is to read through the many pages on dsjob in the manual.
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.
Thanks Craig!!
I have started working on the script:
The logic i have tried is :
1)Listing out all the jobs in a project using -ljobs
2)While executing -jobinfo for each job if the string "Job Status : RUN FAILED (3)",that job name should be written to the status file.
But i am facing the error on 4th line (executing -jobinfo for each job)
Still i am working on this..
I have started working on the script:
Code: Select all
. /opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/dsenv
touch status.`date +%m`.`date +%d`.txt
for job_name in `/opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/bin/dsjob -server servername -user uname -password pwd -ljobs prjname `
/opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/bin/dsjob -server servername -user uname -password pwd -jobinfo $job_name | grep "Job Status : RUN FAILED (3)"
if [ $? -eq 0 ]
do echo $job_name >> /home/status.`date +%m`.`date +%d`.txt
done
fi
done
1)Listing out all the jobs in a project using -ljobs
2)While executing -jobinfo for each job if the string "Job Status : RUN FAILED (3)",that job name should be written to the status file.
But i am facing the error on 4th line (executing -jobinfo for each job)
Still i am working on this..
pandeeswaran
Hi,
I have little bit modified the script:
But still i am getting failed to open project -1002 error.
Can anyone help me on this?
Thanks
I have little bit modified the script:
Code: Select all
. /opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/dsenv
sfile=$(date "+status.%m.%d.%H.%M.txt")
touch $sfile
for job_name in `/opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/bin/dsjob -server servername -user unam -password pwd -ljobs PRJDEV`
do
/opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/bin/dsjob -server servname-user unam -password pwd -jobinfo $job_name PRJDEV | grep "Job Status : RUN FAILED (3)"
if [ $? -eq 0 ]
then
echo $job_name >> /path/$sfile
fi
done
Can anyone help me on this?
Thanks
Last edited by pandeesh on Sun Aug 07, 2011 11:49 pm, edited 1 time in total.
pandeeswaran
The error failed to open project arose because of incorrect syntax in -jobinfo option:
The above code eliminates that error.
Code: Select all
do
/opt/app/dstage/DataStage752/Ascential/DataStage/DSEngine/bin/dsjob -server servname -user unam -password pwd -jobinfo PRJDEV $job_name | grep "Job Status : RUN FAILED (3)"
Last edited by pandeesh on Sun Aug 07, 2011 11:49 pm, edited 1 time in total.
pandeeswaran
i am struggling to get the aborted jobs alone
For example i have a job called 'job123' which has been finished fine .
So while executing the below code:
it gives:
So, while executing the below code:
it should return non zero return code since it doesn't contain the search string.
so $? gives 1.
At the same time, the below code also returns 1(even though the search term is found).
Can any one help me on this?
Thanks
For example i have a job called 'job123' which has been finished fine .
So while executing the below code:
Code: Select all
dsjob -serverservname-user uname -password pwd -jobinfo Prjname job123
Code: Select all
Job Status : RUN OK (1)
Job Controller : not available
Job Start Time : Mon Feb 21 00:04:09 2011
Job Wave Number : 1
User Status : not available
Job Control : 0
Interim Status : NOT RUNNING (99)
Invocation ID : not available
Last Run Time : Mon Feb 21 00:04:11 2011
Job Process ID : 0
Invocation List : job123
Status code = 0
Code: Select all
dsjob -server servname -user uname -password pwd -jobinfo Prjname job123
|grep "Job Status : RUN FAILED (3)"
so $? gives 1.
At the same time, the below code also returns 1(even though the search term is found).
Code: Select all
dsjob -server servname -user uname -password pwd -jobinfo Prjname job123
|grep "Job Status : RUN OK (1)"
Thanks
pandeeswaran
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto
Hi,
My requirement is :
if the output of the command ,
contains the string " Job Status : RUN FAILED (3)" , the jobname 'job123' should be written to a file.
Thanks
My requirement is :
if the output of the command ,
Code: Select all
dsjob -server servname -user uname -password pwd -jobinfo Prjname job123
Thanks
pandeeswaran
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto
-
- Premium Member
- Posts: 258
- Joined: Tue Jul 04, 2006 10:35 pm
- Location: Toronto