SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
24x7 MP 4.3.293 - Job to Shutdown / Auto-Restart ?

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
24x7 MP 4.3.293 - Job to Shutdown / Auto-Restart ?
Author Message
mbenton



Joined: 08 Feb 2010
Posts: 38
Country: United Kingdom

Post 24x7 MP 4.3.293 - Job to Shutdown / Auto-Restart ? Reply with quote
Hi,
I would like to create a 24x7 Job to Auto-Restart the scheduler, or at least Shutdown the scheduler in a clean manner.
I have seen example scripts for performing a restart for a Windows scheduler, but not for a Linux based scheduler.

What method/code would you recommend to shutdown/restart a 24x7 MP server ?
Tue Aug 03, 2010 5:24 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
If you are running it on Windows system as a service, the same method could be used, create and schedule a batch file to restart the service
NET STOP "24x7 Scheduler"
NET START "24x7 Scheduler"


Please check the service name it may be a bit different in different versions

If you are running it on *nix system, create and schedule a shell script to restart the daemon using 24x7_constrol.sh script
./24x7_constrol.sh stop
./24x7_constrol.sh start

Tue Aug 03, 2010 8:50 am View user's profile Send private message
mbenton



Joined: 08 Feb 2010
Posts: 38
Country: United Kingdom

Post Reply with quote
Thanks for the quick reply :-)

Sorry, this might be a silly question, but where is the "24x7_constrol.sh" script ? Cannot find it in the Scheduler install directory.

[24x7 Scheduler MP 4.3.293 on Red Hat 5.x]
Tue Aug 03, 2010 10:30 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
Here is the code of that file

Code:
#!/bin/sh

###########################################################
# The first parameter must be either 'start', 'check', 
# or 'stop', for example:
#
# ./24x7_control.sh start
###########################################################

if [ "$1" = "start" ]
then
   # start 24x7 if it is not already running
   ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "Starting Alert Center server..."
      ./master.sh nogui &
      echo "Scheduler started."
   else
      echo "Scheduler already running."
   fi
elif [ "$1" = "check" ]
then
   # check 24x7 is running
   ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "Scheduler is not running"
            rsh <mail> mailx -s "<Scheduler>" <mail>
            exit 1
   else
      echo "Scheduler running."
   fi

elif [ "$1" = "stop" ]
then
   # find and kill the process
        ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "ERROR:  Scheduler not running."
      exit 1
   else
                ps xu | grep -v grep | grep jscheduler.jar  | awk '{ print $2 }' | xargs kill -9
      echo "Terminate signal has been sent to Scheduler process."
   fi
else
   echo "ERROR:  Invalid command line parameters"
   echo "Example 1: ./24x7_control.sh start"
   echo "Example 2: ./24x7_control.sh stop"
      echo "Example 3: ./24x7_control.sh check"
   exit 1
fi

Tue Aug 03, 2010 2:25 pm View user's profile Send private message
mbenton



Joined: 08 Feb 2010
Posts: 38
Country: United Kingdom

Post Reply with quote
Magic. Just what I was looking for. Manny Thanks :-)
Wed Aug 04, 2010 5:14 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I'm sorry, I've noticed that the message board engine is removing text appearing in HTML like format. Here is re-posted script, using double quotes instead of brackets for HTML tags.


Code:
#!/bin/sh

###########################################################
# The first parameter must be either 'start', 'check', 
# or 'stop', for example:
#
# ./24x7_control.sh start
###########################################################

if [ "$1" = "start" ]
then
   # start 24x7 if it is not already running
   ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "Starting Scheduler..."
      ./master.sh nogui &
      echo "Scheduler started."
   else
      echo "Scheduler is already running."
   fi
elif [ "$1" = "check" ]
then
   # check 24x7 is running
   ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "Scheduler is not running"
      rsh "mail server here" mailx -s "Scheduler process not running" "mail.id"
      exit 1
   else
      echo "Scheduler is running."
   fi

elif [ "$1" = "stop" ]
then
   # find and kill the process
      ps -ef | grep -v grep | grep jscheduler.jar

   if [ $? -eq 1 ]
   then
      echo "ERROR:  Scheduler is not running."
      exit 1
   else
      ps xu | grep -v grep | grep jscheduler.jar  | awk '{ print $2 }' | xargs kill -9
      echo "Terminate signal has been sent to Scheduler process."
   fi
else
   echo "ERROR:  Invalid command line parameters"
   echo "Example 1: ./24x7_control.sh start"
   echo "Example 2: ./24x7_control.sh stop"
   echo "Example 3: ./24x7_control.sh check"
   exit 1
fi

Wed Aug 04, 2010 8:32 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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 vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.