automatic start up in CONTROL-M /AGENT 6.2

Everything about Control-M agents installation or setup.
Post Reply
User avatar
fredsmh38
Nouveau
Nouveau
Posts: 7
Joined: 05 Jul 2006 12:00
Location: GRENOBLE

Post by fredsmh38 » 23 Apr 2007 10:44

Hello,

That's normal process.

On V6.2 Agent, the autostart is not in inetd.

You need to put a start and stop script in /etc/rc.d/rc2.d directory

By example like this :

#!/bin/sh
#
# $Id$
#
# Startup script for ctm client
#
# $Log$
#
# chkconfig: 2345 99 01
# description: startup script for ctmtools agent
#

CTMCLI=ctmclixx <----------- (name of your ctm client)

if [ -z "$CTMCLI" ] ; then
echo "\$CTMCLI not set"
exit 1
fi

DIR=`ksh -c "echo ~$CTMCLI"`

if [ -z "$DIR" ] ; then
echo "Unable to find directory of user $CTMCLI"
exit 0
fi

if [ ! -d "$DIR" ] ; then
echo "$CTMCLI not correctly installed"
exit 0
fi

case "$1" in
'start')
echo "Starting agent $CTMCLI"
"$DIR"/ctm/scripts/start-ag -u "$CTMCLI" -p ALL
if [ $? -eq 0 ]; then
echo "Agent started successfully"
else
echo "Agent did not start successfully"
exit 2
fi
;;
'stop')
echo "Stopping agent $CTMCLI"
"$DIR"/ctm/scripts/shut-ag -u "$CTMCLI" -p ALL
if [ $? -eq 0 ]; then
echo "Agent stopped successfully"
else
echo "Agent did not stop successfully"
exit 3
fi
;;

'restart')
echo "Stopping agent $CTMCLI"
"$DIR"/ctm/scripts/shut-ag -u "$CTMCLI" -p ALL
if [ $? -eq 0 ]; then
echo "Agent stopped successfully"
else
echo "Agent did not stop successfully"
fi
echo "Starting agent $CTMCLI"
"$DIR"/ctm/scripts/start-ag -u "$CTMCLI" -p ALL
if [ $? -eq 0 ]; then
echo "Agent started successfully"
else
echo "Agent did not start successfully"
exit 4
fi
;;

'status')
echo "Checking agent $CTMCLI"
su - "$CTMCLI" -c "ctm/scripts/ag_diag_comm"
su - "$CTMCLI" -c "ctm/scripts/shagent"
;;

*)
echo "Usage: $0 { start | stop | status }"
exit 4
;;
esac
exit 0

Regards

Fredsmh38

Post Reply