Hermien

ESP_Start and Stop script for Unix agent

Discussion created by Hermien on May 19, 2014
Latest reply on May 20, 2014 by Hermien

Hello

Since upgrading to SP2  and also defining new paths for agents.
When the unix server is bounced the unix agent is not automatically starting by itself.

We need to change our ESP_STart script to reflect the new path or upgrade of SP2.

 

Does anyone know what to change in this script or run into this after the upgrade to SP2?

 

This is the Start script.     CA guys said it was the responsibility of our unix guys to figure it out.  

Any ideas?

 

#!/usr/bin/ksh

SCS_PREFIX=/scs

SCS_COMMON=system/scripts

esp_work_path=$($SCS_PREFIX/$SCS_COMMON/real_pathname.ksh $0)

#

# setup of variables

esp_work_dir=$(dirname $esp_work_path)

esp_start_log=audit/esp_start.`date +%Y%b%dT%H:%M:%S`

esp_agent_program=cybAgent

 

print "*****************************************************************************">> $esp_work_dir/$esp_start_log

print "$0 - $(date) Steelcase startup script for Cybermation ESP Agent beginning" >> $esp_work_dir/$esp_start_log

print "***** My working directory is $esp_work_dir" >> $esp_work_dir/$esp_start_log

print "***** The Operating System and Hardware Type for this agent is " >> $esp_work_dir/$esp_start_log

uname -a >> $esp_work_dir/$esp_start_log

print "***** The contents of the status.os file shows" >>  $esp_work_dir/$esp_start_log

cat $esp_work_dir/status.os >> $esp_work_dir/$esp_start_log

print "***** Current users logged into this system are " >> $esp_work_dir/$esp_start_log

who >> $esp_work_dir/$esp_start_log

print "***** WHOAMI results are" >> $esp_work_dir/$esp_start_log

whoami >> $esp_work_dir/$esp_start_log

print "***** Current cybAgent processes are " >> $esp_work_dir/$esp_start_log

ps -ef|grep cyb >> $esp_work_dir/$esp_start_log

cd $esp_work_dir

#

# start esp as the root user

nohup $esp_work_dir/$esp_agent_program >> $esp_work_dir/$esp_start_log 2>&1 &

#

esp_return_code=$?

 

print "$0 - $(date) Steelcase startup script for Cybermation ESP Agent completed - RC = $esp_return_code" >> $esp_work_dir/$esp_start_log

print "*****************************************************************************">> $esp_work_dir/$esp_start_log

chmod 775 $esp_work_dir/$esp_start_log

exit $esp_return_code

 

 This is the stop script.   

 

#!/usr/bin/ksh

SCS_PREFIX=/scs

SCS_COMMON=system/scripts

esp_work_path=$($SCS_PREFIX/$SCS_COMMON/real_pathname.ksh $0)

# setup of variables

esp_work_dir=$(dirname $esp_work_path)

esp_agent_program=cybAgent

esp_status_file=status.os

esp_stop=audit/esp_stop.`date +%Y%b%dT%H:%M:%S`

 

# stop esp

print "*****************************************************************************" >> $esp_work_dir/$esp_stop

print "$0 - $(date) Steelcase shutdown script for Cybermation ESP Agent beginning" >> $esp_work_dir/$esp_stop

print "***** My working directory is $esp_work_dir" >> $esp_work_dir/$esp_stop

print "***** The contents of the status.os file shows" >>  $esp_work_dir/$esp_stop

cat $esp_work_dir/$esp_status_file >> $esp_work_dir/$esp_stop

print "***** Current users logged into this system are " >> $esp_work_dir/$esp_stop

who >> $esp_work_dir/$esp_stop

print "***** WHOAMI results are" >> $esp_work_dir/$esp_stop

whoami >> $esp_work_dir/$esp_stop

print "***** Current cybAgent processes are " >> $esp_work_dir/$esp_stop

ps -ef|grep cyb >> $esp_work_dir/$esp_stop

cd $esp_work_dir

print "***** Invoking cybAgent program *****" >> $esp_work_dir/$esp_stop

$esp_work_dir/$esp_agent_program -s >> $esp_work_dir/$esp_stop 2>&1 &

esp_return_code=$?

print "***** Printing Return Code *****" >> $esp_work_dir/$esp_stop

print $esp_return_code >> $esp_work_dir/$esp_stop

 

print "$0 - $(date) Steelcase shutdown script for Cybermation ESP Agent complete" >> $esp_work_dir/$esp_stop

print "*********************************************************************" >> $esp_work_dir/$esp_stop

chmod 775 $esp_work_dir/$esp_stop

exit

 

 

 

 

 

This is what is in the cybAgent  file

 

 

=> more cybAgent

#!/bin/sh

#

# cybAgent for hpux-ia-64

#

LD_PRELOAD="/scs_apps/cyb_agent/DM1/r11.3/jre/lib/IA64W/libjava.so"

export LD_PRELOAD

LD_LIBRARY_PATH="/scs_apps/cyb_agent/DM1/r11.3:/scs_apps/cyb_agent/DM1/r11.3/jre

/lib/IA64W/server:/scs_apps/cyb_agent/DM1/r11.3/jre/lib/IA64W:$LD_LIBRARY_PATH"

export LD_LIBRARY_PATH

 

cd '/scs_apps/cyb_agent/DM1/r11.3'

exec `pwd`/cybAgent.bin "$@"

 

Outcomes