Author |
Message
|
thimerion |
Posted: Tue Jun 12, 2007 1:59 am Post subject: Monitoring Queue Message Age |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
Hi,
I have written a unix script that checks for the queue depth using the queue properties, and raises an alert when the queue depth > 0.
This works when there is a problem and the application is not picking up messages ...
However, it also gives an alert if the application is processing a lot of messages and the queue is not yet empty ...
Is there a way that I can check for the age of the oldest message using a unix script ? Or do I have to go and write a java program for that ? In either case, is there already an example app that is doing that ?
Thanks a lot,
Tim |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 2:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you're worried about the application running behind, try a depth event. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
thimerion |
Posted: Tue Jun 12, 2007 2:29 am Post subject: Application |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
Hi,
Application is running fine ...
Just try to detect when the application is not running or picking up messages.
Therefor I have a script that runs runmqsc and greps the depth out of it.
As I said before, it works fine, but also alerts when heavy traffic, not only if the application is stopped.
I am looking for a way or script of java app to check the age of messages.
Tim |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 2:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
If you want to check put date you'll need to write a script to do it by browsing the messages. Be aware this will impact performance so schedule prudently.
If it was me, I'd grep to see if the program was running and use a depth event to see if it needed help. But it's not me. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Tue Jun 12, 2007 2:41 am Post subject: Re: Application |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 3:27 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You have different options in v6 than you do in v5.3. If you're using v6, you can ask for the age of the oldest message on the queue.
In both versions, you can ask for how many messages have been DEQUEUED in the last x minutes.
I am skipping my usual rant about the build vs. buy value propositions of professional monitoring tools . _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Tue Jun 12, 2007 3:29 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 3:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jefflowrey wrote: |
You have different options in v6 than you do in v5.3. If you're using v6, you can ask for the age of the oldest message on the queue.
|
I have so got to spend more time reading up on performance and monitoring, especially in v6!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
thimerion |
Posted: Tue Jun 12, 2007 3:36 am Post subject: unix |
|
|
Acolyte
Joined: 08 May 2007 Posts: 67 Location: Belgium
|
In both versions, you can ask for how many messages have been DEQUEUED in the last x minutes.
Can you do that in unix, or only with the java api ?
Tim |
|
Back to top |
|
 |
dgolding |
Posted: Tue Jun 12, 2007 3:56 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
There's a function called mqExecute with the command MQCMD_RESET_Q_STATS that will return number of messages enqueued and dequeued since the function was last run.
I think there is a support pack or a sample program that uses this. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 4:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's accomplished, across the board, with PCF messages. RESET QUEUE STATISTICS is the PCF command.
You can create PCF messages from any language that can create an MQ message.
There's a Java support pack that supplies helper classes for PCF messages.
The Perl module for MQSeries supplies helper classes for PCF messages.
You can't script MQ message from Unix without using a program that can talk to the MQ API... _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
dgolding |
Posted: Tue Jun 12, 2007 4:08 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
The sample program I was trying to remember was AMQSAICQ.C, which uses the MQ Admin Interface (MQAI) to send PCF requests to the command server. This could be modified to use the MQCMD_RESET_Q_STATS.
But, did I remember something, where the MQAI was discontinued due to supreme lack of interest? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 4:36 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
dgolding wrote: |
But, did I remember something, where the MQAI was discontinued due to supreme lack of interest? |
I think the official IBM recommendation is that it not be used for new development. Due, as I believe you correctly point out, to a supreme lack of interest. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
battie |
Posted: Sun Jul 01, 2007 4:08 pm Post subject: Monitoring Queue Message Age |
|
|
 Newbie
Joined: 04 Feb 2007 Posts: 8 Location: Sydney
|
Why don't you set a service interval on the queue and monitor the perfomance events. _________________ Battie |
|
Back to top |
|
 |
dgolding |
Posted: Mon Jul 02, 2007 2:28 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
Hi Matt,
The only trouble with that is the event only gets generated when something happens on the queue - a PUT or a GET. If a message is put on the queue and then nothing happens for several hours, only when the message is GET'd or another PUT is done will an event be created - a little but too late
Don |
|
Back to top |
|
 |
battie |
Posted: Mon Jul 02, 2007 3:45 pm Post subject: Monitoring Queue Message Age |
|
|
 Newbie
Joined: 04 Feb 2007 Posts: 8 Location: Sydney
|
Don, In that case then cron the amqsbcg >/dev/null utility every 5 min to force browse all the messages. If the message size is large then it would be better to knock up something that only scans the MQMD. This will trigger the performance event as well as clean out any expired messages.
Matt _________________ Battie |
|
Back to top |
|
 |
|