MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  /var/mqm/errors/AMQERR0x in JSON ?

    Posted Wed February 23, 2022 09:27 AM
    By specifying the correct values in the qm.ini of a Queue Manager, it is possible to have AMQERR0x files in json format, to analyse them more easily.

    Some Queue Manager related errors are not logged in /var/mqm/qmgrs/<qmgr>/errors/AMQERR0x, but in /var/mqm/errors/AMQERR0x.
    For example:
    • AMQ8063E: Not authorized to issue command 'strmqm'.
    • AMQ9520E: Program could not find a definition of channel.
    Is there a way to get a json version of /var/mqm/errors/AMQERR0x files?

    Thanks.

    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    ------------------------------


  • 2.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Thu February 24, 2022 04:44 AM
    Edited by Mark Taylor Thu February 24, 2022 05:21 AM
    Use the DiagnosticSystemMessages stanza in /var/mqm/mqs.ini
    DiagnosticSystemMessages:
    Service = file
    Name = JSONLogs
    FilePrefix = AMQERR
    Format=json
    ------------------------------
    Mark Taylor
    Winchester
    ------------------------------


  • 3.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Fri February 25, 2022 08:03 AM
    Works perfecly.
    Thanks a lot to all responders, public or private.
    And you don't even have to restart the Queue Manager to take these changes into account!

    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    ------------------------------



  • 4.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Thu March 10, 2022 11:31 AM
    Does this also work on MQ Appliance?
    Sample setmqini command for this.

    ------------------------------
    om prakash
    WI
    ------------------------------



  • 5.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Fri March 11, 2022 04:25 AM

    This is supported on the appliance, please see:

    https://www.ibm.com/docs/en/mq-appliance/9.2?topic=logs-mq-diagnostic-message-services#concept_bxh_mh3_4fb

     

    You need to use the setmqini -g invocation:

    mqa(mqcli)# setmqini

    Usage: Update an MQ configuration file.

     

    Update a queue manager configuration file (qm.ini)

      setmqini -m QMgrName ((-s StanzaName [-n ObjectName] -k KeyName (-v Value |

    -d)) | -r)

     

    Update the global configuration file (mqs.ini)

      setmqini -g -s StanzaName -n ObjectName -k KeyName (-v Value | -d)

     

     

    -g   Set global setting.

    -m   Queue manager name.

    -s   Stanza name.

    -k   Key name of attribute to set.

    -v   Attribute value to set.

    -d   Delete the attribute or stanza.

    -n   Object name. Valid only for the next stanzas:

              DiagnosticSystemMessages (global),

              DiagnosticMessagesTemplate (global),

              DiagnosticMessages (queue manager).

    -r   Permanently reset automatic configuration ini baseline.

     

    The -k parameter is optional when both -n and -d are specified.

     

    Regards,

     

    Sam Massey,

    IBM MQ Performance,
    DE2A25, MP 211, Hursley, IBM United Kingdom Ltd.,

    ibm.webex.com/meet/smassey – UK 01527 357294,
    Internal Tel: 246189, Notes: Sam Massey/UK/IBM@IBMGB,
    External Tel/Fax: +44 (0)1962 816189, Email: smassey@uk.ibm.com

     






  • 6.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Fri March 11, 2022 09:37 AM
    Thanks Sam.
    Can this be setup on appliance as log stream?

    ------------------------------
    om prakash
    WI
    ------------------------------



  • 7.  RE: /var/mqm/errors/AMQERR0x in JSON ?

    Posted Fri March 11, 2022 04:30 AM

    Yes, you can configure JSON logs on the MQ Appliance.

    The following setmqini commands will create the DiagnosticSystemMessages stanza that Mark cited above. The -g parameter indicates to update the global mqs.ini file. To update a queue manager's qm.ini file you specify -m <qmname> instead.

    mqa(mqcli)# setmqini -g -s DiagnosticSystemMessages -n JSONLogs -k Service -v file
    mqa(mqcli)# setmqini -g -s DiagnosticSystemMessages -n JSONLogs -k FilePrefix -v AMQERR
    mqa(mqcli)# setmqini -g -s DiagnosticSystemMessages -n JSONLogs -k Format -v json

    mqa(mqcli)# dspmqini -g -s DiagnosticSystemMessages -n JSONLogs
    DiagnosticSystemMessages:
    Format = json
    FilePrefix = AMQERR
    Name = JSONLogs
    Service = file


    For more information about using setmqini to configure a diagnostic message service on the appliance see https://www.ibm.com/docs/en/mq-appliance/9.2?topic=services-configuring-diagnostic-message

    You cannot stream these JSON log files from the appliance so you will need to download them to a remote system to process them, which you can do by using scp (from the appliance), REST, or the web UI. To stream the MQ error logs from the appliance you use a log target to send the log entries to a remote syslog server, or similar. For information about how to configure a log target to stream the MQ error logs see https://www.ibm.com/docs/en/mq-appliance/9.2?topic=targets-log-target-examples



    ------------------------------
    Jamie Squibb
    IBM MQ Development
    ------------------------------