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 » IBM MQ Performance Monitoring » Monitoring Queue Message Age

Post new topic  Reply to topic
 Monitoring Queue Message Age « View previous topic :: View next topic » 
Author Message
thimerion
PostPosted: Tue Jun 12, 2007 1:59 am    Post subject: Monitoring Queue Message Age Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 12, 2007 2:14 am    Post subject: Reply with quote

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
View user's profile Send private message
thimerion
PostPosted: Tue Jun 12, 2007 2:29 am    Post subject: Application Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 12, 2007 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message
marcin.kasinski
PostPosted: Tue Jun 12, 2007 2:41 am    Post subject: Re: Application Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Here you have JAVA mq browse example:

http://www-304.ibm.com/jct09002c/isv/tech/sample_code/mq/amqsbcg.java


You have to change this code and print put date and time oldests message.

Then this output you can use within your script.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Jun 12, 2007 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 12, 2007 3:29 am    Post subject: Reply with quote

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
View user's profile Send private message
thimerion
PostPosted: Tue Jun 12, 2007 3:36 am    Post subject: unix Reply with quote

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
View user's profile Send private message
dgolding
PostPosted: Tue Jun 12, 2007 3:56 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Tue Jun 12, 2007 4:04 am    Post subject: Reply with quote

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
View user's profile Send private message
dgolding
PostPosted: Tue Jun 12, 2007 4:08 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Tue Jun 12, 2007 4:36 am    Post subject: Reply with quote

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
View user's profile Send private message
battie
PostPosted: Sun Jul 01, 2007 4:08 pm    Post subject: Monitoring Queue Message Age Reply with quote

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
View user's profile Send private message Visit poster's website
dgolding
PostPosted: Mon Jul 02, 2007 2:28 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
battie
PostPosted: Mon Jul 02, 2007 3:45 pm    Post subject: Monitoring Queue Message Age Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Performance Monitoring » Monitoring Queue Message Age
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.