It is currently 15 Aug 2018 7:25


Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 14 May 2013 7:06 
Offline
Nouveau
Nouveau
User avatar

Joined: 27 Sep 2011 12:00
Posts: 13
Location: São Paulo
Hi. I have a need that isn't covered natively by Control-m. Need to set an alert to all Jobs that detect if a job is running for more than 24 hours.

I thought of using "exectime", but the longer value is 999.

Is there a way to do this? If a job is running for more than 24 hours, shout an alert to ECS, for example.

If yes, how so?

Thanks in advance


Top
   
 Post subject: Try this as a script
PostPosted: 15 May 2013 5:56 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Nov 2008 12:00
Posts: 188
Location: Bogotá
Execute this script every 5 minutes, all day.

Execution Parameters :

USUARI=${1} # root
DIRECT=${2} # Your sysout Control-M estandar directory
FILESS=${3} # *.out
MINCON=${4} # Your max time in minutes
EMAILS=${5} # email list for send in case


This script check por sysout file in Control-M directory and validate execution time. You must use this script in each agent to validate all process in each agent.

This is the escript in AIX or Linux version. (Sorry no windows version yet)

verif_sysout()
{
cd ${DIRECT}
num_files=0
LISTIN=""
ENVCORREO=""
fecact=`date +%H%M`
min1=`expr substr ${fecact} 1 2 \* 60 + substr ${fecact} 3 2`

ls -l ${FILESS} | grep ${USUARI} | grep -v "^d" | awk '{print $9}'

for plano in `ls -l ${FILESS} | grep ${USUARI} | grep -v "^d" | awk '{print $9}'`
do
echo "Checking File : ${plano}"

fecpla=`ls -l ${plano} | awk '{print $8}' | awk -F\: '{print $1$2}'`
min2=`expr substr ${fecpla} 1 2 \* 60 + substr ${fecpla} 3 2`
min=`expr ${min1} - ${min2}`
[ ${min} -gt ${MINCON} ] &&
{
ENVCORREO="Listing of Jobs with too much time"
num_files=`expr ${num_files} + 1`
LISTIN="${LISTIN}\n `ls ${plano}` running since ${min} minutes ..."
}
done
[ "${ENVCORREO}" ] &&
{
echo ${LISTIN}
# Replace GFN_ENV_CORREO.sh with your local script to send mail.
${CTMFUN}/GFN_ENV_CORREO.sh !! CTM TIME WARNING !! there are ${num_files} process with execution time higher than ${MINCON} Minutes ${EMAILS} ${LISTIN}
} || sleep 0
}


Top
   
 Post subject:
PostPosted: 15 May 2013 10:22 
Offline
Nouveau
Nouveau
User avatar

Joined: 27 Sep 2011 12:00
Posts: 13
Location: São Paulo
th_alejandro, thank you so much.

I'll give this script a try. At least for agente that hosts most of the critical jobs.

Do you know if there is a way to do the same, but running only in one server, like CTM Server? I was thinking about running some sort of DB Query and make this time calculations from the query results, for example.


Top
   
 Post subject: Sorry
PostPosted: 18 May 2013 1:09 
Offline
Nouveau
Nouveau
User avatar

Joined: 26 Nov 2008 12:00
Posts: 188
Location: Bogotá
Sorry Saint_ago, but i design this shell to run using the sysout files user by control-m in each agent. So, you need to install this script in each machine that you want to check.

May be it's possible to define another script that runs only in the server and 'collect' all information from other servers. For example, if you mapping all the filesystem names of other server (directory where are the agents sysout) in the main server.

Agent A: /agent_A mapping file system as /agente_a/sysouts
Agent B: /agent_B mapping file system as /agente_b/sysout
Server : Mapping filesystem to see /agent_a, /agent_b


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved