|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
use QMgrname and Status in a script |
« View previous topic :: View next topic » |
Author |
Message
|
Michael Dag |
Posted: Thu Jan 08, 2004 2:58 pm Post subject: use QMgrname and Status in a script |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Posted earlier, but can be modified for all kinds of purposes:
How to find out in a script if Qmgr(s) is(are) Running...
On Solaris/AIX:
Code: |
#!/usr/bin/ksh
dspmq | grep -v Running | cut -d '(' -f2,3 | cut -d ')' -f1 | while read qmgr
do
status=`dspmq -m $qmgr | cut -d '(' -f2,3 | cut -d ')' -f2 | cut -d '(' -f2`
echo QMgr $qmgr is $status
done |
On Windows:
Code: |
for /F "tokens=1,2,3,4,5,* delims=()" %i IN ('dspmq') DO @IF NOT %l==Running echo QMgr %j is %l |
above scripts already ignore Running qmgrs, replace the 'echo ...' statement with the action you want to 'perform'.
Variations
execute a command against all Running QMgrs:
On Solaris/AIX:
Code: |
#!/usr/bin/ksh
dspmq | grep Running | cut -d '(' -f2,3 | cut -d ')' -f1 | while read qmgr
do
command_to_execute $qmgr
done |
On Windows:
Code: |
for /F "tokens=1,2,3,4,5,* delims=()" %i IN ('dspmq') DO @IF %l==Running command_to_excute %j |
execute a command against all QMgrs:
On Solaris/AIX:
Code: |
#!/usr/bin/ksh
dspmq | cut -d '(' -f2,3 | cut -d ')' -f1 | while read qmgr
do
command_to_execute $qmgr
done |
On Windows:
Code: |
for /F "tokens=1,2,3,4,5,* delims=()" %i IN ('dspmq') DO command_to_excute %j |
Michael |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|