Shell Script for Websphere MQ Queue Manager start/stop


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script for Websphere MQ Queue Manager start/stop
# 1  
Old 06-22-2015
Oracle Shell Script for Websphere MQ Queue Manager start/stop

Hello All,

I am completely new to shell scripting. I had to write a script that starts and stop the queue manager in Websphere MQ. We are on Linux 64-bit patform.
The script should stop the queue manager and all the processes related to websphere MQ. It should be a clean stop. Once the queue manager is stopped, it should start back.

Can some one please help me. Its something urgent !!
# 2  
Old 06-22-2015
Welcome to the forum!

What have you tried so far? Can you post your script that is not working?
# 3  
Old 06-22-2015
Hello Paddy1224,

Welcome to forum, please use code tags for commands/codes/Inputs in your posts as per forum rules. I have made following a sample for MQ (Which I never worked) STOP/START/CHECK script, hope this may help you. You need to take it as a start up and try to change appropriate oath details, with process name etc and let us know then if that helps you.
Code:
 PATH=/tmp
STOP_SCRIPT=/tmp/stop_MQ.ksh
START_SCRIPT=/tmp/start_MQ.ksh
 CHECK_SERVICES_STATUS(){
CHECK_STATUS=`ps -ef | grep -v "grep" | grep "MQ_process_name_here_please"`
}
 
STOP_SERVICES() {
CHECK_SERVICES_STATUS
if [[ -n $CHECK_STATUS ]]
then
 $STOP_SCRIPT
 CHECK_SERVICES_STATUS
  if [[ -z $CHECK_STATUS ]]
  then
   echo "All MQ services have been stopped now."
  fi
else
 echo "Seems MQ processes are NOT running."
fi
}
  
 START_SERVICES() {
CHECK_SERVICES_STATUS
if [[ -z $CHECK_STATUS ]]
then
 echo "Seems services are NOT up, starting them now......"
 $START_SCRIPT
 CHECK_SERVICES_STATUS
  if [[ -n $CHECK_STATUS ]]
  then
   echo "All MQ services have been started successfully now."
  else
   echo "Seems services haven't been started please check from your end...."
  fi
else
 echo "Services seems to be already up, please check it...."
fi
}
 
  
 
echo "**************************************************"
echo "Welcome to MENU script for STOPPIN/STARTING MQ processes script:"
echo "Please select appropriate options to use the menu script:
echo "Please enter STOP for stopping services, START for starting services, CHECK for checking status of services, QUIT for quiting the script."
echo ""
echo ""
 echo "1) STOP all MQ processes."     
echo "2) START all MQ processes."
echo "3) CHECK status of all MQ processes."
echo "4) QUIT menu script."
echo "@#"
 read INPUT_FROM_USER
 case ($INPUT_FROM_USER) in 
"STOP") STOP_SERVICES;;
"START") START_SERVICES;;
"CHECK") CHECK_SERVICES_STATUS;;
"*") echo "Please enter STOP or START or CHECK, apart from these 3 no options are allowed."
esac

Save above script as eg--> menu.ksh give proper permissions to it with proper details by changing paths etc details for scripts. Hope this helps(enjoy learning).


EDIT: Sorry Aia, I haven't seen your reply before this, but this is not a complete solution it is a start up for user.


NOTE: I haven't tested script it should be taken as a startup and appropriate changes according to user's requirement should be done to it.


Thanks,
R. Singh

Last edited by RavinderSingh13; 06-22-2015 at 01:07 PM.. Reason: Added sorry to Aia as was replying while Aia replied to thread before me and couldn't see Aia's reply.
These 2 Users Gave Thanks to RavinderSingh13 For This Post:
# 4  
Old 06-22-2015
Quote:
Originally Posted by RavinderSingh13

EDIT: Sorry Aia, I haven't seen your reply before this, but this is not a complete solution it is a start up for user.
No worries! You give what you feel you want to give.
However, I think is appropriated to ask what has been the effort done if nothing is shown. That would let you know as well the level of understanding that the person has on the issue and helps you to not assume more than what you have to.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to stop and start server

Hi, I need to create a shell script for automated server patching, with the following scenario: I have two Linux servers Primary and secondary. Server patching should start on Primary 1st and then secondary. 1st check both servers are up and running. Then stop primary and patching will... (1 Reply)
Discussion started by: rcroyal88
1 Replies

2. Shell Programming and Scripting

MQ Queue Manager SSL Checking Script

Hello everyone, Newbie to the forum. I have a requirement for a script to check Queue Manager SSL certificates - However I have no previous scripting skills what so ever. I need a script which from high level point of view does the following: #For each Queue Manager on the server go to... (1 Reply)
Discussion started by: MQAdmin
1 Replies

3. Solaris

Stop/start script problem on Solaris-10

I have Big brother script, which start/stop Big Brother processes. Something got change on server and now I am not able to start/stop it. There is no change in script, as I compared it from other server. This service is being managed by bb user (group is also bb). root@tsazdq04:/#... (6 Replies)
Discussion started by: solaris_1977
6 Replies

4. UNIX for Dummies Questions & Answers

Shell Scripting Stop/Start Application

I did a search of these forums but couldnt find a suitable resolution. I am attempting to script a stop and start of an application on AIX. Such as: However it has authentication where username and password prompts will appear after running the above command requiring input from a... (2 Replies)
Discussion started by: Soupy
2 Replies

5. Shell Programming and Scripting

Help with stop/start Shell Script.

Hi All, I would like to develop a shell script for stop & start an application server (1-4) on Solaris box. Here are the user requirements for this task. 1. User will input the option which server they wish to stop. 2. Will clear cache files from specific location. 3. ... (1 Reply)
Discussion started by: venga
1 Replies

6. UNIX for Dummies Questions & Answers

Need help making a start/stop script...

i have two separate scripts that work nicely to curl and generate two files.. one html and one txt so a total of four. When the script starts up i want it to: call and run shellscripta call and run shellscriptb sleep for about 40 seconds again run shellscripta again run shellscriptb check... (4 Replies)
Discussion started by: phpfreak
4 Replies

7. UNIX for Dummies Questions & Answers

Stop a shell script

Hi, I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following: mike=1 if ; then STOP THE SCRIPT fi (3 Replies)
Discussion started by: msb65
3 Replies

8. Shell Programming and Scripting

Start and stop of an application thru shell scripts.

Hi, I just learnt the shell scripting and got working on that right now. I have one problem. Here i am having a java application that needs to be start and stop using two shell scripts, i.e., starting the java application using one shell script and stopping the application using another... (1 Reply)
Discussion started by: sadha
1 Replies

9. UNIX for Dummies Questions & Answers

Start/Stop Script

I'm a newbie to the Unix world Help! I have to maintain a host of Sybase database servers sitting on Unix Sun Solaris 8...I've been tasked with finding/creating a way to auto start/stop Unix via unix commands, specifically when the Unix servers need to be restarted we want Sybase to start... (2 Replies)
Discussion started by: jjv1
2 Replies
Login or Register to Ask a Question