Skip to content

Commit

Permalink
Update for MQ 9.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ibmmqmet committed Jun 21, 2023
1 parent 2bace34 commit 7d17830
Show file tree
Hide file tree
Showing 24 changed files with 88 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
Newest updates are at the top of this file.

## Jun 21 2023 - v5.5.0
- Update for MQ 9.3.3
- mqmetric - Configurable timeout for status queries (ibm-messaging/mq-metric-samples#227)

## Feb 17 2023 - v5.4.0
- Update for MQ 9.3.2
- mqmetric - Add hostname tag for 9.3.2 qmgrs (added to DIS QMSTATUS response) (ibm-messaging/mq-metric-samples#184)
Expand Down
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ FROM $BASE_IMAGE

ARG GOPATH_ARG="/go"
ARG GOVERSION=1.17
ARG GOARCH=amd64
ARG MQARCH=X64

ENV GOVERSION=${GOVERSION} \
GOPATH=$GOPATH_ARG \
GOTAR=go${GOVERSION}.linux-amd64.tar.gz \
GOTAR=go${GOVERSION}.linux-${GOARCH}.tar.gz \
ORG="github.com/ibm-messaging"


Expand Down Expand Up @@ -57,8 +59,8 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \

# Location of the downloadable MQ client package \
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
VRMF=9.3.2.0
RDTAR="IBM-MQC-Redist-Linux${MQARCH}.tar.gz" \
VRMF=9.3.3.0

# Install the MQ client from the Redistributable package. This also contains the
# header files we need to compile against. Setup the subset of the package
Expand All @@ -80,8 +82,8 @@ RUN chmod 777 $GOPATH/buildInDocker.sh
# Copy the rest of the source tree from this directory into the container
# And make sure it's readable by the id that will run the compiles (not just root)
ENV REPO="mq-golang"
COPY . $GOPATH/src/$ORG/$REPO
RUN chmod -R a+rx $GOPATH/src
COPY --chmod=0777 . $GOPATH/src/$ORG/$REPO
# RUN chmod -R a+rx $GOPATH/src

# Set the entrypoint to the script that will do the compilation
ENTRYPOINT $GOPATH/buildInDocker.sh
7 changes: 4 additions & 3 deletions ibmmq/cmqc_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
7 changes: 4 additions & 3 deletions ibmmq/cmqc_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
7 changes: 4 additions & 3 deletions ibmmq/cmqc_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
7 changes: 4 additions & 3 deletions ibmmq/cmqc_linux_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
7 changes: 4 additions & 3 deletions ibmmq/cmqc_linux_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
7 changes: 4 additions & 3 deletions ibmmq/cmqc_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ package ibmmq
****************************************************************
*
* <BEGIN_BUILDINFO>
* Generated on: 2/7/23 5:13 PM
* Build Level: p932-L230207
* Generated on: 5/31/23 12:58 PM
* Build Level: p933-L230531
* Build Type: Production
* <END_BUILDINFO>
*/
Expand Down Expand Up @@ -1032,7 +1032,7 @@ const (
MQCMDI_SEC_SIGNOFF_ERROR int32 = 17
MQCMDI_SEC_TIMER_ZERO int32 = 14
MQCMDI_SEC_UPPERCASE int32 = 21
MQCMDL_CURRENT_LEVEL int32 = 932
MQCMDL_CURRENT_LEVEL int32 = 933
MQCMDL_LEVEL_1 int32 = 100
MQCMDL_LEVEL_101 int32 = 101
MQCMDL_LEVEL_110 int32 = 110
Expand Down Expand Up @@ -1082,6 +1082,7 @@ const (
MQCMDL_LEVEL_930 int32 = 930
MQCMDL_LEVEL_931 int32 = 931
MQCMDL_LEVEL_932 int32 = 932
MQCMDL_LEVEL_933 int32 = 933
MQCMD_ACCOUNTING_MQI int32 = 167
MQCMD_ACCOUNTING_Q int32 = 168
MQCMD_ACTIVITY_MSG int32 = 69
Expand Down
2 changes: 2 additions & 0 deletions ibmmq/mqistr.go
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,8 @@ func MQItoString(class string, value int) string {
s = "MQCMDL_LEVEL_931"
case 932:
s = "MQCMDL_LEVEL_932"
case 933:
s = "MQCMDL_LEVEL_933"
default:
s = ""
}
Expand Down
4 changes: 2 additions & 2 deletions mqmetric/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ func collectChannelStatus(pattern string, instanceType int32) error {
// Now get the responses - loop until all have been received (one
// per channel) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
key := parseChlData(instanceType, cfh, buf)
if key != "" {
Expand Down Expand Up @@ -612,7 +612,7 @@ func inquireChannelAttributes(objectPatternsList string, infoMap map[string]*Obj
}

for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseChannelAttrData(cfh, buf, infoMap)
}
Expand Down
4 changes: 2 additions & 2 deletions mqmetric/channelamqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func collectAMQPChannelStatus(pattern string, instanceType int32) error {
// Now get the responses - loop until all have been received (one
// per channel) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
key := parseAMQPChlData(instanceType, cfh, buf)
if key != "" {
Expand Down Expand Up @@ -427,7 +427,7 @@ func inquireAMQPChannelAttributes(objectPatternsList string, infoMap map[string]
}

for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseAMQPChannelAttrData(cfh, buf, infoMap)
}
Expand Down
2 changes: 1 addition & 1 deletion mqmetric/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func collectClusterStatus() error {
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseClusterData(cfh, buf)
}
Expand Down
2 changes: 2 additions & 0 deletions mqmetric/globals.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type connectionInfo struct {
discoveryDone bool
publicationCount int

waitInterval int

objectStatus [OT_LAST_USED + 1]objectStatus
publishedMetrics AllMetrics
}
Expand Down
4 changes: 2 additions & 2 deletions mqmetric/metrics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vary by queue manager platform and version.
As an example, one of the metrics available in Prometheus might be "ibmmq_channel_bytes_sent" with
the full name created by combining the product name, the class, and the individual metric.

The metrics published by the queue manager are listed in the product documentation are
The metrics published by the queue manager are listed in the product documentation and
are not repeated in this file:
https://www.ibm.com/docs/en/ibm-mq/latest?topic=trace-metrics-published-system-topics

Expand Down Expand Up @@ -119,4 +119,4 @@ Class: bufferpool/pageset
ATTR_PS_TOTAL : pages_total
ATTR_PS_UNUSED : pages_unused

This page was automatically generated from the source tree on 2023-02-15 07:35:57
This page was automatically generated from the source tree on 2023-06-20 09:33:10
13 changes: 8 additions & 5 deletions mqmetric/mqif.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ConnectionConfig struct {
ShowInactiveChannels bool
HideSvrConnJobname bool
HideAMQPClientId bool
WaitInterval int

CcdtUrl string
ConnName string
Expand Down Expand Up @@ -182,6 +183,7 @@ func initConnectionKey(key string, qMgrName string, replyQ string, replyQ2 strin
var v map[int32]interface{}

ci.useStatus = cc.UseStatus
ci.waitInterval = cc.WaitInterval

mqod := ibmmq.NewMQOD()
openOptions := ibmmq.MQOO_INQUIRE + ibmmq.MQOO_FAIL_IF_QUIESCING
Expand Down Expand Up @@ -407,9 +409,10 @@ func subscribeDurable(topic string, pubQObj *ibmmq.MQObject) (*MQTopicDescriptor
}

/*
subscribe to the } else {
s.removeSubscription()
}nominated topic, but ask the queue manager to
subscribe to the } else {
s.removeSubscription()
}nominated topic, but ask the queue manager to
allocate the replyQ for us
*/
func subscribeManaged(topic string, pubQObj *ibmmq.MQObject) (*MQTopicDescriptor, error) {
Expand Down Expand Up @@ -563,7 +566,7 @@ func clearDurableSubscriptions(prefix string, cmdQObj ibmmq.MQObject, replyQObj
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
subName, subId := parseInqSubData(cfh, buf)
if subName != "" {
Expand Down Expand Up @@ -603,7 +606,7 @@ func clearDurableSubscriptions(prefix string, cmdQObj ibmmq.MQObject, replyQObj
// Don't really care about the responses, just loop until
// the operation is complete one way or the other
for allReceived := false; !allReceived; {
_, _, allReceived, _ = statusGetReply()
_, _, allReceived, _ = statusGetReply(putmqmd.MsgId)
}
}

Expand Down
4 changes: 2 additions & 2 deletions mqmetric/qmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func collectQueueManagerListeners() error {
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
if parseQMgrListeners(cfh, buf) {
listenerCount++
Expand Down Expand Up @@ -324,7 +324,7 @@ func collectQueueManagerStatus(instanceType int32) error {
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseQMgrData(instanceType, cfh, buf)
}
Expand Down
6 changes: 3 additions & 3 deletions mqmetric/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func collectQueueStatus(pattern string, instanceType int32) error {
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseQData(instanceType, cfh, buf)
}
Expand Down Expand Up @@ -303,7 +303,7 @@ func collectResetQStats(pattern string) error {
// Now get the responses - loop until all have been received (one
// per queue) or we run out of time
for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseResetQStatsData(cfh, buf)
}
Expand Down Expand Up @@ -368,7 +368,7 @@ func inquireQueueAttributes(objectPatternsList string) error {
}

for allReceived := false; !allReceived; {
cfh, buf, allReceived, err = statusGetReply()
cfh, buf, allReceived, err = statusGetReply(putmqmd.MsgId)
if buf != nil {
parseQAttrData(cfh, buf)
}
Expand Down
Loading

0 comments on commit 7d17830

Please sign in to comment.