Installing and Configuring IBM MQ with Datadog on a Linux System

Danang Priabada
4 min readSep 2, 2024

--

This guide will walk you through the process of installing IBM MQ, configuring it, and setting up Datadog to monitor your MQ environment.

Installing IBM MQ

You need to download the IBM MQ installation package. This package is available to eligible customers with the appropriate licensing.

Extract the IBM MQ Installation Package

First, download and extract the IBM MQ package to the /tmp/ directory:

tar -xzvf IBM_MQ_9.3.0.15_LNX_X86-64.tar.gz -C /tmp/

Navigate to the MQServer Directory

cd /tmp/MQServer

Accept the License Agreement

./mqlicense.sh -accept

Install IBM MQ by executing the following command:

rpm -ivh MQSeries*
   1:MQSeriesRuntime-9.3.0-15         ################################# [  3%]
2:MQSeriesJava-9.3.0-15 ################################# [ 6%]
3:MQSeriesJRE-9.3.0-15 ################################# [ 9%]
...
32:MQSeriesSDK-9.3.0-15 ################################# [100%]

Upon successful installation, you will see output similar to the following, indicating that the various components of IBM MQ have been installed

Set IBM MQ as the Primary Installation

After installation, configure IBM MQ to be the primary installation on your system:

cd /opt/mqm/bin/
./setmqinst -i -p /opt/mqm
Name:        IBM MQ
Version: 9.3.0.15
Level: p930-015-231129
BuildType: IKAP - (Production)
Platform: IBM MQ for Linux (x86-64 platform)
Mode: 64-bit
O/S: Linux 5.14.0-503.el9.x86_64
O/S Details: CentOS Stream 9
InstName: Installation1
InstDesc:
Primary: Yes
InstPath: /opt/mqm
DataPath: /var/mqm
MaxCmdLevel: 930
LicenseType: Production

Set the Password for the MQM User

Finally, set a password for the mqm user:

passwd mqm

Configuring IBM MQ

Start MQSC (MQ Script Command) and Create a Listener

Use the MQSC command to start the configuration process:

runmqsc QM.POC

DISPLAY LISTENER(*)
DEFINE LISTENER(LISTENER.POC) TRPTYPE(TCP) CONTROL(QMGR) PORT(1234)
DISPLAY LSSTATUS(LISTENER.POC)
START LISTENER(LISTENER.POC)

Define and Start a Channel

Define and start a server connection channel for administrative purposes:

DISPLAY CHANNEL(*)
DEFINE CHANNEL (SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) REPLACE
SET CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('NOBODY', 'MQMADMIN') ACTION(REPLACE)
DISPLAY CHANNEL(SYSTEM.ADMIN.SVRCONN)
START CHANNEL(SYSTEM.ADMIN.SVRCONN)

Set MQ Object Authorities

Assign the necessary authorities for the mqm group to connect to the queue manager:

setmqaut -m QM.POC -t qmgr -g mqm +connect

Installing the Datadog Agent

Install Datadog Agent

Install the Datadog Agent on your server using the following command. Replace DD_API_KEY with your actual Datadog API key:

DD_API_KEY=your_datadog_api_key DD_SITE="datadoghq.com" bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent7.sh)"
Create for The First Time
Create the Next Agent

Installation Status

....
Installed:
datadog-agent-1:7.56.1-1.x86_64

Complete!

* Adding your API key to the Datadog Agent configuration: /etc/datadog-agent/datadog.yaml

* Setting SITE in the Datadog Agent configuration: /etc/datadog-agent/datadog.yaml

/usr/bin/systemctl
* Starting the Datadog Agent...

Your Datadog Agent is running and functioning properly.
It will continue to run in the background and submit metrics to Datadog.
If you ever want to stop the Datadog Agent, run:

systemctl stop datadog-agent

And to run it again run:

systemctl start datadog-agent

Configuring Library Paths for IBM MQ

Update the Library Path

Update the library paths to include the MQ libraries:

export LD_LIBRARY_PATH=/opt/mqm/lib64:/opt/mqm/lib:$LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH

Persist the Library Path Configuration

To ensure that the MQ libraries are always accessible, add the library paths to the system configuration:

sudo sh -c "echo /opt/mqm/lib64 > /etc/ld.so.conf.d/mqm64.conf"
sudo sh -c "echo /opt/mqm/lib > /etc/ld.so.conf.d/mqm.conf"
sudo ldconfig
[root@centos-server ld.so.conf.d]# pwd
/etc/ld.so.conf.d
[root@centos-server ld.so.conf.d]# ls
mqm64.conf mqm.conf pipewire-jack-x86_64.conf
[root@centos-server ld.so.conf.d]# cat mqm64.conf
/opt/mqm/lib64
[root@centos-server ld.so.conf.d]# cat mqm.conf
/opt/mqm/lib

Configure Datadog to Monitor IBM MQ

Copy and Edit the IBM MQ Integration Configuration

Copy the sample configuration file for IBM MQ and make the necessary edits:

sudo cp /etc/datadog-agent/conf.d/ibm_mq.d/conf.yaml.example /etc/datadog-agent/conf.d/ibm_mq.d/conf.yaml

Edit the conf.yaml file to include your MQ configuration details:

Read this for more details : https://docs.datadoghq.com/integrations/ibm_mq/

init_config:
is_gevent: false

instances:
- channel: "SYSTEM.ADMIN.SVRCONN"
host: "192.168.72.11"
port: 1234
queue_manager: "QM.POC"
username: "mqm"
password: "mqm"

Restart the Datadog Agent

After making the necessary changes, restart the Datadog Agent to apply the new configuration:

sudo systemctl restart datadog-agent

Verify Datadog Agent Status for IBM MQ

Check the status of the Datadog Agent to confirm that the IBM MQ integration is working correctly:

sudo datadog-agent status | grep mq

Expected output should indicate that the IBM MQ instance is being monitored:


[root@centos-server ibm_mq.d]# sudo datadog-agent status | grep mq
ibm_mq (6.3.0)
Instance ID: ibm_mq:2cb783732da3de08 [OK]
Configuration Source: file:/etc/datadog-agent/conf.d/ibm_mq.d/conf.yaml
version.scheme: ibm_mq

Access Datadog Dashboard

List of Metrics : https://docs.datadoghq.com/integrations/ibm_mq/?tab=host#data-collected

  • Metrics: Lists specific metrics that are collected, such as queue depth, message rate, and connection status.
  • Logs: Describes how to configure log collection from IBM MQ, which can be useful for monitoring error messages and operational issues.
  • Service Checks: Provides information on health checks that Datadog can perform on IBM MQ to monitor its availability and performance.

--

--

Danang Priabada
Danang Priabada

Written by Danang Priabada

Red Hat and IBM Product Specialist | JPN : プリアバダ ダナン | CHN : 逹男 | linktr.ee/danangpriabada

No responses yet