Author |
Message
|
basabi2520 |
Posted: Tue Jul 03, 2012 6:04 pm Post subject: Clarification : email alert when queue is 80% |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
Hi,
This post is related to my previous topic. Need to get an email alert when a queue is nearing 80%. According to my understanding have listed out some points. Can anyone help whether my study is rite? so that i can test.
1. Create an performance event when queue reaches 80%
ALTER QMGR PERFMEV(ENABLED)
ALTER QLOCAL('MYQUEUE') QDEPTHHI(80) QDPHIEV(ENABLED)
2. Define a trigger when a msg put into the queue and it calls for a process definition
DEFINE QLOCAL(TRIG.EXAMPLE.QLOCAL) +
DESCR('Example Queue for Triggering') +
DEFPRTY(0) +
DEFSOPT(SHARED) +
GET(ENABLED) +
MAXDEPTH(5000) +
MAXMSGL(4194304) +
MSGDLVSQ(PRIORITY) +
PUT(ENABLED) +
RETINTVL(999999999) +
TRIGTYPE(EVERY) +
PROCESS(TRIG.EXAMPLE.PROCESS) +
INITQ(TRIG.EXAMPLE.INITQ) +
USAGE(NORMAL) +
REPLACE
3. Process definition calls an application script written in .bat,.sh,etc
DEFINE PROCESS (TRIG.EXAMPLE.PROCESS) +
DESCR('Example Process for Triggering') +
APPLTYPE(UNIX) +
APPLICID(/MQ/emailMessage.sh) +
REPLACE
5. runmqtrm -m QMNAME -q TRIG.EXAMPLE.INITQ &
4. Script sends an email alert.
thanks,
Baskar |
|
Back to top |
|
|
Mr Butcher |
Posted: Tue Jul 03, 2012 10:35 pm Post subject: |
|
|
Padawan
Joined: 23 May 2005 Posts: 1716
|
why dont you just test to verify your study is right? _________________ Regards, Butcher |
|
Back to top |
|
|
basabi2520 |
Posted: Tue Jul 03, 2012 10:51 pm Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
Thanks for your reply. This is my initial study and was given a task. Since am new to MQ i was not given permission to execute commands even in test env. So finding difficult , If you could tell me , am i understanding it correctly?? so that it will be helpful for me to explore further and can get permission to test !!!
thanks
Baskar |
|
Back to top |
|
|
exerk |
Posted: Tue Jul 03, 2012 11:51 pm Post subject: |
|
|
Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
Change the TRIGTYPE to FIRST is one suggestion, as to the reason why, the manual will explain better than I can. Overall what you are doing is OK, but consider that if you are generating an alert at 80% full, what might happen between the time that event is generated and the email being received and reacted to, i.e. you might want to think about automated queue depth increase too. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
|
basabi2520 |
Posted: Wed Jul 04, 2012 12:24 am Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
exerk thanks for your reply and suggestions. |
|
Back to top |
|
|
PeterPotkay |
Posted: Wed Jul 04, 2012 5:34 am Post subject: |
|
|
Poobah
Joined: 15 May 2001 Posts: 7717
|
exerk wrote: |
you might want to think about automated queue depth increase too. |
If you'll allow some process to automatically increase the max q depth in the future, why not just build the queue to begin with at that true max q depth? Relying on some automatic process to increase the q depth to what you really need just introduces a point of failure. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
|
exerk |
Posted: Wed Jul 04, 2012 8:06 am Post subject: |
|
|
Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
PeterPotkay wrote: |
exerk wrote: |
you might want to think about automated queue depth increase too. |
If you'll allow some process to automatically increase the max q depth in the future, why not just build the queue to begin with at that true max q depth? Relying on some automatic process to increase the q depth to what you really need just introduces a point of failure. |
A valid point. The problem I have is that the customer at my present site doesn't know what their messages sizes are, or frequency, let alone likely max depths. I could just as easily set 999,999,999 as a max depth but prefer not to. At the moment I'm using automation to trap problem-child areas in a project that is a lift-and-shift, and in truth a bit of a mess. Once I have a profile for the solution, I can set attributes correctly. I'm sure there are better ways of doing it _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
|
basabi2520 |
Posted: Mon Sep 03, 2012 7:49 pm Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
Hi all,
Back with the same old topic. From previous replies have tested on getting a automated mail when queue reaches 80%
ALTER QLOCAL(SY31.SM.TESTQ) QDEPTHHI(80) QDPHIEV(ENABLED) MAXDEPTH(10)
PROCESS(SY31.SM.PROCESS) INITQ(SY31.SM.INITQ)
PROCESS(SY31.SM.PROCESS) APPLTYPE(UNIX)
APPLICID(/appn/sy31/QdepthHiAlert.sh) ENVRDATA( )
USERDATA( )
DESCR(PROCESS FOR TESTING QDEPTH HIGH EVENT)
But i get alert mails for every messages put into the queue. Looking forward your help to sort out this problem. Where am i making the mistake.
thanks,
basabi2520 |
|
Back to top |
|
|
bruce2359 |
Posted: Mon Sep 03, 2012 10:13 pm Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
Yep, you sure do. You have (incorrectly) enabled triggering for SY31.SM.TESTQ thinking that this will trigger an email. Triggering this queue will launch an app to consume (process) your app messages. What you really want (in addition to processing your app messages) is an event message when the queue reaches 80% full.
Yes, you have enabled qdepthhi. When the event occurs, the qmgr puts an event message into an instrumentation event queue.
It is the instrumentation queue that you want to also trigger, so that when the event occurs, your app will get the event message, and send an email. _________________ 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 |
|
|
basabi2520 |
Posted: Sun Sep 16, 2012 10:33 pm Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
Thanks bruce2359 .
It works fine after enabling performance event and i can send an alert mail from the process defined in it.
Can anyone help me how to get the queue name in the process definition and send as a parameter to the mail script????
thanks |
|
Back to top |
|
|
bruce2359 |
Posted: Mon Sep 17, 2012 4:27 am Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
The queue name is found in the trigger event message.
What value is there in getting an email when the queue gets to 80%? Will you be able to do something in time to avoid queue-full?
What is your hesitation in setting maxdepth to 999,999,999?
You could write a script that sets maxdepth up by 20% when queue-depth-high event occurs; then set it down by %20 when queue-depth-low occurs. This would allow for spikes in message arrival. _________________ 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 |
|
|
basabi2520 |
Posted: Mon Sep 17, 2012 5:48 pm Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
bruce2359 thanks for your suggestion . Am still in testing phase. Hop will take sometime to a real testing in production.
Some more clarifications:
1. Below is the alert mail body content which i never specified. From where does it comes from??? perfm.event or trigger msg ???
TMC 2SYSTEM.ADMIN.PERFM.EVENT SY31.SM.PROCESS /appn/sy31/QdepthHiAlert.sh /appn/sy31/bds1mailheader MQT25
2. How to read SYSTEM.ADMIN.PERFM.EVENT and trigger msgs?
Thanks |
|
Back to top |
|
|
basabi2520 |
Posted: Mon Sep 17, 2012 5:50 pm Post subject: |
|
|
Apprentice
Joined: 05 Jun 2012 Posts: 28 Location: singapore
|
With all the suggestions and guides i hope am in rite track . Am i?? |
|
Back to top |
|
|
fjb_saper |
Posted: Mon Sep 17, 2012 7:48 pm Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20729 Location: LI,NY
|
bruce2359 wrote: |
You could write a script that sets maxdepth up by 20% when queue-depth-high event occurs; then set it down by %20 when queue-depth-low occurs. This would allow for spikes in message arrival. |
Dangerous thinking... if memory serves well once queue high depth is triggered it won't trigger again until qdepth low is triggered. That is unless you manually reset the trigger. So if you up the qdepth by 20% and leave the trigger at 80% will that trigger again when the threshold gets hit without first passing qlow? I thought this was another reason why most of these notifications are done by the monitoring software and not qdepth events... _________________ MQ & Broker admin |
|
Back to top |
|
|
bruce2359 |
Posted: Mon Sep 17, 2012 7:53 pm Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
basabi2520 wrote: |
1. Below is the alert mail body content which i never specified. From where does it comes from??? perfm.event or trigger msg ???
TMC 2SYSTEM.ADMIN.PERFM.EVENT SY31.SM.PROCESS /appn/sy31/QdepthHiAlert.sh /appn/sy31/bds1mailheader MQT25
|
This is a trigger message (TMC). The format of a trigger message may be found in the WMQ Application Programming Reference, or by searching google for 'websphere mq+tmc'.
Trigger messages are created when a trigger fires. Data in the trigger message is taken from fields from the QLocal and Process definition.
basabi2520 wrote: |
2. How to read SYSTEM.ADMIN.PERFM.EVENT ... msgs? |
amqsbcg SYSTEM.ADMIN.PERFM.EVENT queuemanagername _________________ 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 |
|
|
|