Extracting failed job information (urgent)

Everything about Control-M Enterprise Manager Server installation or setup.
Post Reply
maheshvenu

Extracting failed job information (urgent)

Post by maheshvenu » 10 Jun 2010 11:03

How to extract from the Control-M alert log of all the job which runs on certain node id which failed between 2359 and 0030 over the pass 14 days.

The extract should contain:

Job Name

Node ID

Script Path

Script Name

Command Line

Start Time

End Time



Thanks and Regards

Maheshvenu

User avatar
jchannel
Nouveau
Nouveau
Posts: 5
Joined: 20 Jan 2006 12:00

Post by jchannel » 12 Jun 2010 7:16

What version are you on and what platform and database?

This sounds like a good candidate for the Reporting Facility Active Jobs from Archived Net but the report is not there yet. There is a canned report that can get a certain archived net but not a range of dates. MY suggestion is this - I will open a ticket for an Enhancement for this.

There are ways to do this at the database level -- taking the BMC line, I would not recommend this as it will not be supported BUT if you would like to discuss this further we could certainly do that.

Hope it helps.
J

User avatar
Eight
Nouveau
Nouveau
Posts: 41
Joined: 03 May 2010 12:00

Post by Eight » 14 Jun 2010 6:33

Reporting facility would be best but if you don’t have it running (also you don’t mention which version you are running). If you are trying to use the ctmlog utility then you most likely have to script it because you are looking for a lot of info back and you want to select every day between selected times which the parameters don’t allow you to do. Using different list options you should get most of the info you are looking for.

ctmlog
1. LIST
2. LISTORD
3. LISTJOB
4. LISTSS
5. LISTMSG
6. LISTJOBNAME

Example: ctmlog listmsg "5134" 20100601 2359 20100614 0000


Date: 14-Jun-2010. Page: 1

CTMLOG REPORT from 20100601 235900 to 20100614 000059

Msgidm : 5134

+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Date|Time|Jobname |Order|SS|MID |Message |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|0607|1040|TestSNMPa_c |0000h|TR|5134|ENDED NOTOK |
|0607|1041|TestSNMPa_c |0000h|TR|5134|ENDED NOTOK

hipikll

Post by hipikll » 14 Jun 2010 8:33

very simply example:

Code: Select all

#!/bin/bash

out_file=/tmp/ctmlist_output.out
start_time=2200
end_time=0500
start_date=20100611
end_date=$(( $start_date + 1 ))

i=0
num_days # remember, there is end of month, end of year - calculate it yourself. It is simply too.

while [ $i -lt $num_days ]; do
  ctmlog -listall $start_date $start_time $end_date $end_time | grep 'ENDED NOTOK' | cut -d"|" -f2,3 >> $out_file
 i=$(( $i + 1 ))
done
With out file you can do other tasks, you can even generate sql query in while. Then run the generated query and you can get more informations directly from database.

I havent tested it, I wrote it just during the supper, so correct all of the mistakes, make a 'month and year changer' and youre ready to go.

Post Reply