Help on ctmcreate

Several scripts
Post Reply
User avatar
Bobby005
Nouveau
Nouveau
Posts: 2
Joined: 01 Nov 2007 12:00

Help on ctmcreate

Post by Bobby005 » 15 Oct 2009 12:05

I am trying to build a script which utilizes ctmcreate with error catching. As an example,

ctmcreate adasdasdas
RC=${?}
if [ ${RC} -ne 0 ] ; then
echo "FAILED"
else
echo "SUCCESS"
fi
exit ${RC}

This should output FAILED and exit with a number other than 0 as the ctmcreate statement is wrong but it always would output SUCCESS and 0.. Please help.

Please tell me how I could catch all possible errors with the ctmcreate statement and exit with a number other than 0 if wrong..

Thanks.



Even this fails..


[xxxxx@ethp1234:/home/xxxxx]
$ ctmcreate asdadad
Invalid parameter:
usage: ctmcreate
….
..


[xxxxx@ethp1234:/home/xxxxx]
$ echo $?
0

User avatar
ranger67
Nouveau
Nouveau
Posts: 52
Joined: 03 Jan 2008 12:00

Post by ranger67 » 15 Oct 2009 12:58

Bobby, which version of the agent and server are you running? I am running a 6.3 and 6.4 server with 6.3 agents. A ctmcreate issued at either the agent or server side does issue an RC of 1 upon on unsuccessful run.

I would verify that your server and agents are fully patched. If that is the case, I would open a case with BMC.

User avatar
Bobby005
Nouveau
Nouveau
Posts: 2
Joined: 01 Nov 2007 12:00

Post by Bobby005 » 18 Oct 2009 2:46

Hi,

I am using 6.1.0.3. If this version of Ctrlm does not issue return codes, what can I do to catch the erros of ctmcreate within the script?

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 19 Oct 2009 9:11

Hi,

A ctmcreate (with no parameters) executed from the agent or the server return an RC=1 upon on unsuccessful run.

Version tested:

V6.1.03.xxx

Control-M/Server Solaris 6.1.03.400 rc=1
Control-M/Agent Solaris 6.1.03.301 rc=1
Control-M/Agent AIX 6.1.03.300 rc=1

V6.3.01.xxx

Control-M/Server Solaris 6.3.01.500 rc=1
Control-M/Server AIX 6.3.01.401 rc=1

Control-M/Agent Solaris 6.3.01.400 rc=1
Control-M/Agent AIX 6.3.01.400 rc=1
Best regards
Walty

User avatar
Allison
Nouveau
Nouveau
Posts: 14
Joined: 22 Sep 2012 12:00

Post by Allison » 23 Sep 2012 8:07

It could be the number of batch slots (or no. of concurrent jobs you can run at one time), or the number of (. ..... In which all way Control M is better than other tools? ...... just modified the batch file to just do one thing:<br> <br> exit 0<br

Post Reply