IBM i Global

 View Only
Expand all | Collapse all

Checking all systems for MSGW

  • 1.  Checking all systems for MSGW

    Posted Thu October 26, 2023 10:44 AM

    Let's say you have all your LPARs of IBM i layed out in the new Navigator like the following:

    How useful do you find it to be able to click on the following:

    And get a screen showing all systems with a message stuck in QSYSOPR like the following:



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------


  • 2.  RE: Checking all systems for MSGW

    Posted Fri October 27, 2023 01:49 AM

    Great tip Rob,

    Please keep them coming! 

    I love this new interface, but as IBM are adding new functionality so fast it's hard to keep up with all the things it can do, so these tips really are a great reminder

    Cheers Brad 



    ------------------------------
    Steve Bradshaw Friendly Techie Bloke
    ------------------------------



  • 3.  RE: Checking all systems for MSGW

    Posted Fri October 27, 2023 01:49 AM

    That is very good.

    In my case I have written a CL program that monitors for any MSGW on all systems and sends an email with the details.



    ------------------------------
    Edward Camilleri
    ------------------------------



  • 4.  RE: Checking all systems for MSGW

    Posted Fri October 27, 2023 02:20 AM

    Thanks Rob,

    I'm agree with Steve ...

    Edward, here one Message Monitor Example

    As a system administrator, you need to be aware of inquiry messages as they occur across your system. You can set up a message monitor to display any inquiry messages in your message queue that occur on your system.

    https://www.ibm.com/support/pages/node/6558224



    ------------------------------
    Fernando Plaza
    IBM i System Administrator
    CD INVEST
    MADRID
    ------------------------------



  • 5.  RE: Checking all systems for MSGW

    Posted Fri October 27, 2023 04:17 AM

    Thanks Robert. 

    I agree with Steve, keep the insights coming.  There are other methods but this is a great, free feature.



    ------------------------------
    michael woodard
    ------------------------------



  • 6.  RE: Checking all systems for MSGW

    Posted Fri October 27, 2023 07:17 AM
    Edited by ace ace Fri October 27, 2023 07:19 AM

    Nice feature to have.

    But rarely is a thing to check "synchronously" or willingly.... so I just let my monitoring system to hit the partition with a query like

    SELECT JOB_NAME FROM TABLE(QSYS2.ACTIVE_JOB_INFO()) WHERE JOB_STATUS IN ('MSGW')

    and alert the interested parties.

    To check messages (but they can have a running job or not, maybe the job with the exception ended... so I just prefer to directly check for job_status) one can use something like

    SELECT MESSAGE_ID, MESSAGE_TEXT, MESSAGE_TIMESTAMP
      FROM TABLE(QSYS2.MESSAGE_QUEUE_INFO(MESSAGE_FILTER => 'INQUIRY'));



    ------------------------------
    --ft
    ------------------------------



  • 7.  RE: Checking all systems for MSGW

    Posted Mon October 30, 2023 01:48 PM

    You could also combine these so that you'll only get back the inquiry messages for jobs that are still sitting in MSGW.

    SELECT MESSAGE_ID, MESSAGE_TEXT, MESSAGE_TIMESTAMP, FROM_JOB
        FROM TABLE ( QSYS2.MESSAGE_QUEUE_INFO(MESSAGE_FILTER => 'INQUIRY') )
             JOIN TABLE (
                     SELECT JOB_NAME
                         FROM TABLE ( QSYS2.ACTIVE_JOB_INFO() )
                         WHERE JOB_STATUS IN ('MSGW') )
                 ON JOB_NAME = FROM_JOB;
    

    You could even incorporate QSYS2.QCMDEXC() and dynamically build SNDSMTPEMM commands so that executing the SQL itself will generate the alerts.  So many cool ways to accomplish things like this nowadays!



    ------------------------------
    Steven Riedmueller
    Certified IBM i Admin
    Speaker, Mentor, and Advocate
    ------------------------------



  • 8.  RE: Checking all systems for MSGW

    Posted Tue October 31, 2023 09:08 AM

    I created a version awhile back
    Active jobs in MSGW (github.com)

    that shows the line in the joblog that "caused" the message



    ------------------------------
    Bryan Dietz
    ------------------------------



  • 9.  RE: Checking all systems for MSGW

    Posted Tue October 31, 2023 04:03 AM

    Using this one here, as a Nagios for i service:

            <func id="ReplyMsgINQ">
                    <common-name>Reply Message Num</common-name>
                    <type>list</type>
                    <sql-command><![CDATA[
    SELECT MESSAGE_ID, SEVERITY, MESSAGE_TEXT, FROM_USER, MESSAGE_QUEUE_LIBRARY||'/'||MESSAGE_QUEUE_NAME AS MESSAGE_QUEUE
      FROM QSYS2.MESSAGE_QUEUE_INFO
      WHERE MESSAGE_TYPE = 'INQUIRY'
      AND MESSAGE_KEY NOT IN (select ASSOCIATED_MESSAGE_KEY FROM QSYS2.MESSAGE_QUEUE_INFO WHERE MESSAGE_TYPE = 'REPLY')
      AND FROM_USER NOT IN ('QSPLJOB')
      AND FROM_USER LIKE 'Q%'
    ]]></sql-command>
                    <warning>1</warning>
                    <critical>3</critical>
            </func>



    ------------------------------
    Sylvain Manceau
    ------------------------------



  • 10.  RE: Checking all systems for MSGW

    Posted Wed November 15, 2023 10:00 AM

    Hello Robert,

    I submitted an RFE  last year.  Is this the result of it?

    It was reported that it was included in the 2022 Q4 PTF release.

     



    ------------------------------
    Ryan Speight
    ------------------------------



  • 11.  RE: Checking all systems for MSGW

    Posted Wed November 15, 2023 12:30 PM

    Could be.  I am a customer and not an employee and cannot speak as to the relation.

    But thanks for submitting that idea.



    ------------------------------
    Robert Berendt IBMChampion
    ------------------------------