|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Qmgr Status scripting |
« View previous topic :: View next topic » |
Author |
Message
|
chongkls77 |
Posted: Mon May 12, 2008 9:43 pm Post subject: Qmgr Status scripting |
|
|
Newbie
Joined: 12 May 2008 Posts: 1
|
Hi,
can someone advice me on this post?
I have more than 1 queue managers, how do I modify the below to display more than 1 queue manager status?
##
QMGR=`dspmq|awk '{ print$1 }'|cut -c 8-|sed -e 's/)//'`
MQSTAT=`dspmq|awk '{ print$2 }'|cut -c 8-|sed -e 's/)//'`
if [ "$MQSTAT" = "Running" ]
then
echo "QManager $QMGR $MQSTAT"
else
echo "QManager $QMGR not running"
fi
##
Cheers  |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 13, 2008 3:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You did not specify which platform.
What have you tried, if anything to account for dspmq returning multiple rows?
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
gbaddeley |
Posted: Tue May 13, 2008 6:04 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Assuming generic Unix shell script code, the following works for me:
dspmq | while read mqstatrec ; do
qmname=`echo $mqstatrec | cut -f2 -d\( | cut -f1 -d\)`
qmstat=`echo $mqstatrec | cut -f3 -d\( | cut -f1 -d\)`
echo "$qmname is $qmstat"
done
Where the 'echo' is, you can test the qmname & qmstat variables and do whatever you want.
HTH _________________ Glenn |
|
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
|
|
|
|