MainView AutoOPERATOR for WebSphere MQ: How to pass Alert Text to REXX Execs and send an email?

Version 2
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    MainView AutoOPERATOR


    MainView AutoOPERATOR


    MainView AutoOPERATOR 7.3.nn
    MainView AutoOPERATOR 7.2.nn

    I am creating MVAO Rules for z/OS Websphere MQ Events and I would like a message to be displayed in:
    - the Alerts view in MV Explorer
    - a mail that would be sent by a REXX procedure

    In AutoOPERATOR pannel "Alert Action(s) I - MQS", I have specified:

    BMC Software -------------- Alert Action(s) I - MQS  ------------- AutoOPERATOR
    COMMAND ===>                                                 TGT  --- AOA0    
           Rule-set === RULSTEST             Rule-id  === MODEL008                
    Function ===> ADD                               (ADD, DELETE, DELETEQ)        
    Key      ===> &IMFOQMGR&IMFQ_MD_PUTDATE&IMFQ_MD_PUTTIME                       
    Text     ===> &IMFOQMGR : CONFIGURATION MODIFCATION ON QUEUE                  
    Queues   ===> MQ                                Alert Queue Name(s)           
    Priority ===> CRITICAL                          (CRIT,MAJ,MIN,WARN,INFO,CLEAR)
    Color    ===> YELLOW                            RED,PINK,YEL,DKBL,LTBL,GRE,WHI
    PCMD     ===>                                                                 
    System   ===>                                   Return to target after PCMD   
    * EXEC   ===>                                   Follow-up EXEC                
    Help     ===>                                   Associated HELP Panel         
    Targets  ===>                                   Target System                 
    Udata    ===>                                   User Data                     
    Origin   ===>                                   Origin                        
    User     ===>                                   Userid                        
    Alarm    ===>                                   Sound Alarm (YES/NO)          
    Publish  ===>                                   Alert Publishing Mode         

    The text is well displayed in MainView Explorer Alerts view, so some part of work is already done!

    I usually use the SMTP Rexx provided by MainView to send emails, and it works fine.
    Could you tell me if we can use the "text field" of this panel (so the same text that appears in the Mainview Explorer Alerte view) to send it in email? What would be the variable to use in the queue statement of the REXX Execs started by the rule?

    I've tried using IMFTEXT variable but it doesn't work. It works fine when it is a WTO message that fires the rule, but not where this is an MQ event. I got some strange characters not readables.



    Legacy ID:KA413166


    First of all, the reason the variable IMFTEXT does not display correctly for an MQ event is because MQ events aren't of a textual nature. The contents come from the message buffer and for an MQ event that is not readable text.

    Let me show an example of how I would approach this problem.  Additionally you will not have to create a separate EXEC for each event type that would call the EXEC.  What I'm suggesting is that you build the message text within the rule itself and then pass that data as one line of input to the EXEC.  The EXEC then determines if it was invoked from an MQ rule and gets the message text from the input to the EXEC.

    So, here's the rule Action Specification:

    BMC Software  ---------- Action Specification(s) I - MQS  -------- AutoOPERATOR
    COMMAND ===>                                                 TGT  --- JB73    
           Rule-set === AAORUL00             Rule-id  === MQSMTP00                
    Automation Actions:                                                           
    Journal          ===>           Aux Log ===>                                  
    * Cmd(Type MQ  ) ===>                                                         
    * Issue Msg( WTO ) =>                                                         
    POST Target      ===>                                                         
    POST ID          ===>                                                         
    POST Parms       ===>                                                         
    WebSphere MQ Automation Actions:                                              
    Keep Message     ===> YES    (Yes or NO)   Remove DLH  ===>       (Yes or No) 
    Destination Que  ===>                                                         
    Destination QMgr ===>                                                         
    * Enter a question mark(?) and blank in any field on the line for more options.
    Press ENTER to continue, END return to Detail Control, CANCEL to cancel changes

    Please note that it passes a combination of hard-coded text and variable text to the EXEC.

    Then below is a snippet from a SMTPTEST EXEC which checks to see if the message is an MQ message and if it is then it uses the REXX ARG instruction to capture the input.  It then goes on to clear the blanks and dots from the input and finally queue the single line of email text.

    queue '<''>'                     /* sender */
    queue ''                  /* recipients    */
    cc_users = ' '                             /* copied users          */
    queue 'Email from AO'                      /* Emails subject line   */
    if IMFETYPE = 'MQS' then                                             
      arg input                                /* Get the input         */
      if pos(' .',input) /= 0 then                                       
         input = overlay('',input,pos(' .',INPUT),,                      
         length(input)-pos(' .',input)+1)      /* Clear dots            */
      input = strip(input,'T')                 /* Clear blanks          */
      queue input                              /* Email body            */
       do i = 1 to IMFNOL                                                
         queue value('LINE'||i)                /* Email body            */

    Related Products:  
    1. MainView AutoOPERATOR


    Article Number:


    Article Type:


      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles