ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » check Queue manager availability

Post new topic  Reply to topic
 check Queue manager availability « View previous topic :: View next topic » 
Author Message
vasilev
PostPosted: Mon Jun 03, 2024 5:28 am    Post subject: check Queue manager availability Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 71
Location: Germany

Hello,

what is the best way to check the status of Qmanager - I am asking because need to be 100% sure that QM is operational. the same command will be running on schedule every minute for example.

- dspmq -m QM -s | grep Running | wc -l
- ps -ef|grep lsr | grep QM | wc -l
- echo "dis qmgr qmid" | runmqsc QM | grep QMID | wc -l

if >0 (=1) -> all is fine. if 0 -> not available.

or some better way


thank you
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
gbaddeley
PostPosted: Tue Jun 04, 2024 4:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

The 3 commands all check different aspects:
- The qmgr is in Running status (there could still be internal issues/errors going on)
- The port listener process is running (does not guarantee that its actually listening on a port)
- The qmgr can process MQSC commands (need to check for success, not count lines)

What are you trying to achieve in terms of monitoring the queue manager?
Do you have monitoring and alerting tools that can monitor app usage of MQ, channel status, queue depths and message age etc.?
_________________
Glenn
Back to top
View user's profile Send private message
hughson
PostPosted: Tue Jun 04, 2024 10:54 pm    Post subject: Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1959
Location: Bay of Plenty, New Zealand

Some notes from a monitoring presentation I used to give.

Morag Hughson in Monitoring & Auditing IBM MQ wrote:
The basic question you are trying to determine here is whether the queue manager is alive. Of course that rather depends on what you mean by "alive". In my view it means an application can connect.

One handy to command to remember is PING QMGR. It needs several components to be working, including an application connecting, in order to complete successfully and so it a good test of whether the queue manager is open for business. HA scripts have typically used this to determine the health of a queue manager.

Some people want to test for the existence of particular processes. However, I don't like this. Even if amqzxma0 exists, it does not mean the queue manager can do anything useful.
The dspmq control command is also useful as it also does an MQCONN. It is not designed to programmatically use, also the main drawback about translated fields has been solved in V7.0.1, so it could be used in this way successfully now too.

Some will use the contents of qmstatus.ini file. This is not a reliable method. It will correctly state if a queue manager is down, but you cannot rely on it if it says a queue manager is running, as the queue manager may have failed in a way that meant the update to this file was not able to be made.

The status command for the queue manager, DISPLAY QMSTATUS covers a number of the run-time parts of the queue manager including the command server and channel initiator. It indicates details about the log files if you are using linear logging, and notes whether this is a multi-instance queue manager.

_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Wed Jun 05, 2024 9:11 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

To determine if a qmgr is available to do qmgr work, write a short app that connects to the qmgr, opens a queue, puts a message, closes the queue, then disconnects from the qmgr.

The amqsput sample does this. You have the source code to modify to meet your needs.

What else do you need to know?[/b]
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
vasilev
PostPosted: Fri Jun 07, 2024 4:45 am    Post subject: Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 71
Location: Germany

thank you for the answers!

ok, I have changed to :

echo "display qmstatus" | runmqsc QM | grep RUNNING | wc -l

I am checking with a script every minute if the application server is available, then saving in a file, and then analyzing in the end how many % it was available.
that is why I wanted to be sure that the command is correct and optimal..
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Fri Jun 07, 2024 10:21 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Channels in RUNNING state means that either the channel is currently transmitting a batch of messages OR that it believes it will be able to do so when next it tries. The future is unknown.

Qmgr status RUNNING is a belief - an indicator that only confirms that at that precice instant in time, that the qmgr internals believe that it will be ready to do qmgr work for you, but won't know until next time it tries. Again, the future is unknown.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.


Last edited by bruce2359 on Sat Jun 08, 2024 5:59 am; edited 1 time in total
Back to top
View user's profile Send private message
zpat
PostPosted: Sat Jun 08, 2024 12:03 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

PING QMGR does not work with a z/OS QM.

We had a somewhat paranoid third-party application that tried to use PING QMGR instead of just checking the MQRC on their MQGET.

Didn't work when connected to the z/OS QSG. Also - with a QSG you don't know the QM name.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Jun 10, 2024 4:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Quote:
...that is why I wanted to be sure that the command is correct and optimal

What is your measure of optimal?
I would use
dspmq -m QM
The $? shell variable indicates if the qmgr is running,
0 = Running
Other values = Not Running (error message written to stderr)
_________________
Glenn
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Jun 10, 2024 4:25 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Curious ?

What frequency will you do your test? Every tenth of second? Once per second? Once per minute?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
vasilev
PostPosted: Fri Jun 14, 2024 11:46 am    Post subject: Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 71
Location: Germany

The idea is to measure availability in percent per day.
I am checking every minute, save in a file and in the end of the day count the successful, and divide it to 24x60 - 1.
If there is a better idea , will be happy to try

Quote:
Do you have monitoring and alerting tools that can monitor app usage of MQ, channel status, queue depths and message age etc.?


This is differend but yes I am using java for these things.
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Sat Jun 15, 2024 5:34 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Only sampling once per minute? For more precision, why not once per second? Or 1K times per second?

Do you apply the same/similar methodology to your server hardware? Your cellphone? Your WiFi network? Your car? Your toaster?

Do you intend to report your results as UPTIME? If so, that is imprecise and flawed (inverted) logic. What will management do with your results? Reward you or punish you? Does your organization have SLAs in place for real work?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
vasilev
PostPosted: Sat Jun 15, 2024 10:00 pm    Post subject: Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 71
Location: Germany

As i said, if there are other ideas will be happy to try.
I can check and every second.. if there is such requirement and if it makes sense.
I have read for other well known tools, they are checking the availability depends on now and first time it was available to the monitoring agent.
For me.this is wrong.
External agent can be running but QM stopped for some time during maintenamce.. or whatever.
What about if you have to stop the qm for 10 minutes ? This is planned change and written in the report in the end..
That is why i am checking every mintute.
If there are colleagues doing maintenance and stopping/starting the QM for whatever reason - so planned change for less than a second, will be happy to know them
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Sun Jun 16, 2024 7:38 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

vasilev wrote:
As i said, if there are other ideas will be happy to try.

What precisely is the business requirement? What metric will you use?

If the requirement is to know if a qmgr is able, at a given point in time, to do qmgr work, then develop an application that tests the application requirements.

RUNNING state is MQs belief the qmgr components are currently doing qmgr work, or that it/they will be able to do so the next time it tries.

MQ software is robust and reliable, with built-in error detection and documentation, and built-in self-correction.

Predicting the future is not a function described in the official IBM MQ documentation.

Again, what is your requirement here?

Over the decades, I and others here have worked with a variety of the widely available MQ monitoring tools. I strongly recommend that you research what these tools offer, and compare these to your business requirements.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » check Queue manager availability
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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.