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

Configure IBM MQ Queue Manager Logs with Log DNA 

Thu April 16, 2020 10:21 AM

Configure IBM MQ Queue Manager Logs with Log DNA


Parasmamgain
Published on 14/05/2019 / Updated on 15/05/2019

 

Introduction
You can now configure IBM MQ Queue Manager Logs with Log DNA Service offered in IBM Cloud. A well designed, reliable logging system is a huge utility for developers, system administrators, SRE’s, Devops Engineers, Security team etc. The messages that are recorded in the error logs and queue managers logs are the most important information that you can provide when reporting an MQ problem or while debugging an issue.

 

Why Logging ?
Logging can further be used to configure an Alerting and Monitoring mechanism for the application, system resources etc to alert the engineers in case of some unexpected event is logged in the log files.

 

With IBM Cloud continuously evolving they now offer an enhanced logging experience with IBM Log Analysis with Log DNA, which offers collection and search services with a tightly integrated LogDNA service.

 

What is Log DNA ?
LogDNA can act as a centralized log management service with blazing fast search, intuitive query language, and smart alerting that gives developers and operations engineers the ability to find issues fast.

 

[Optional] for detailed information on Log DNA announcement with LogDNA please visit link here

 

Pre-requisites

  1. A Service instance of Log DNA running in IBM Cloud. Click hereto create one Log DNA instance.
    Note : Incase the above link does not work then goto https://cloud.ibm.com/ -> Log in with your account -> go to to Catalog -> Search “Log DNA” -> Create a LogDNA Service instance.
  2. Installed and ready to use IBM MQ Advanced in your machine.

 

Configuration Steps

In the following guide, I will guide you to configure the IBM MQ Logs with Log DNA

  1. Before starting your queue manager i.e. before executing the MQ strmqmcommand you need to set an Environment Variable. By setting an environment variable AMQ_ADDITIONAL_JSON_LOG with the value 1 prior to running MQ commands, for example starting MQ with strmqm, it will generate JSON formatted error logs as well as the original format.

e.g. for windows SET AMQ_ADDITIONAL_JSON_LOG=1
for linux export AMQ_ADDITIONAL_JSON_LOG=1

  1. Now execute the strmqm QUEUE_MANAGER_NAME
  2. All your queue manager logs in json format will now be available be in location
    (i) for windows system : MQ_INSTALLATION_PATH\QMGRS\qmname\ERRORS\AMQERR01.json
    (ii)for linux system : /var/mqm/qmgrs/qmname/errors
  3. The above steps are illustrated in the screenshot below:

 

 

  1. Now we will start configuring the IBM Log Analysis with Log DNA in IBM Cloud. We expect by now that you would have a running Log DNA service instance in IBM Cloud.

 

  1. Click on “Edit log sources”, this would give details on configuring log DNA with your ubuntu/debian or rpm machines or you can follow the instructions as illustrated below :
  2. Now, you can navigate to directory /var/mqm/qmgrs/QM1/errors using command cd /var/mqm/qmgrs/QM1/errorsand confirm that the logs files will now be present with a *.json extension
  3. we will use following commands for configuring the logDNA agents with the linux system.
    In my case its a docker container where i have my IBM MQ installed. You can run the following commands one by one against your debian/ubuntu box for configuring the logs with Log DNA.

Step 1. echo "deb https://repo.logdna.com stable main" | sudo tee /etc/apt/sources.list.d/logdna.list

Step 2. wget -O- https://repo.logdna.com/logdna.gpg | sudo apt-key add -

Step 3. sudo apt-get update

 

 

The above 3 steps are shown in the screenshot below:

 

 

Step 4. sudo apt-get install logdna-agent < "/dev/null" # this line needed for copy/paste

Step 5. sudo logdna-agent -k # this is your unique Ingestion Key available in your LogDNA Service Instance

Step 6. sudo logdna-agent -s LOGDNA_APIHOST=api.us-south.logging.cloud.ibm.com # this is your API server host

Step 7. sudo logdna-agent -s LOGDNA_LOGHOST=logs.us-south.logging.cloud.ibm.com # this is your Log server host

Step 8. sudo logdna-agent -d /var/mqm/qmgrs/QM1/errors

Step 9. # You can configure the agent to tag your hosts with the hostname like servername1:

Step 9. sudo logdna-agent -t myUbuntu1

Step 10. sudo update-rc.d logdna-agent defaults

Step 11. sudo /etc/init.d/logdna-agent start

 

Following is the screenshot that comprises of the above steps:

 

 

  1. Click on the button "View LogDNA" opens the LogDNA dashoabord where you can search the logs.

 

Result

 

Your queue managers logs should now be available in the LogDNA dashboard, as shown in the screenshot below:

 

Similarly, you can configure the IBM MQ running in different hosts against the same Log DNA service instance and use it as alerting, monitoring and a unified logging service for all your queue manager logs needs.


You can use the various other features provided by Log DNA for more enhancement and improvement on the Log DNA service. Please feel free to drop any suggestions/comments for further improvements.

 

Statistics
0 Favorited
19 Views
1 Files
0 Shares
6 Downloads
Attachment(s)
pdf file
Configure IBM MQ Queue Manager Logs with Log DNA.pdf   953 KB   1 version
Uploaded - Thu April 16, 2020