Skip to content

Commit e090f0d

Browse files
committed
Update for MQ 9.2
1 parent 2340032 commit e090f0d

38 files changed

+281
-242
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Changelog
22
Newest updates are at the top of this file.
33

4-
### Jun 01 2020
4+
### Jul 23 2020
5+
* Update to use v5.1.0 of the mq-golang repository
6+
* Update to use MQ 9.2.0
7+
* Added pseudo-metric qmgr_exporter_publications for how many consumed on each scrape
8+
* Added showInactiveChannels option (#38)
9+
* Added explicit client configuration options (#40)
10+
11+
### Jun 01 2020 (v5.0.0)
512
* Exporters can have configuration provided in YAML file (`-f <file>`) instead of command line options
613
* Use modules (go.mod) to define prereqs (ibm-messaging/mq-golang#138)
714
* Update to use v5.0.0 of the mq-golang repository as the new module format

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ RUN mkdir -p $GOPATH/src $GOPATH/bin $GOPATH/pkg \
5151
# Location of the downloadable MQ client package \
5252
ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
5353
RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
54-
VRMF=9.1.5.0
54+
VRMF=9.2.0.0
5555

5656
# Install the MQ client from the Redistributable package. This also contains the
5757
# header files we need to compile against.
@@ -69,6 +69,9 @@ COPY go.mod .
6969
COPY go.sum .
7070
RUN chmod 777 go.*
7171

72+
COPY config.common.yaml .
73+
RUN chmod 777 config.common.yaml
74+
7275
#RUN /usr/lib/go-${GOVERSION}/bin/go mod download
7376

7477
# Copy the rest of the source tree from this directory into the container and

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ a Grafana bug, or it may really be how Grafana is designed to work. But without
152152
the metric line, the table was showing multiple versions of the status for each channel. This
153153
table combines multiple metrics on the same line now.
154154

155+
Information about channels comes from the DISPLAY CHSTATUS CURRENT command. That
156+
only shows channels with a known state and does not report on inactive channels.
157+
To also see the inactive channels, then set the showInactiveChannels
158+
configuration attribute to true.
159+
155160
### z/OS Support
156161
Because the DIS QSTATUS and DIS CHSTATUS commands can be used on z/OS, the monitors can now
157162
support showing some limited information from a z/OS queue manager. There is nothing special needed to configure it, beyond the client
@@ -195,10 +200,11 @@ Instead of providing all of the configuration for the exporters via command-line
195200
provide the configuration in a YAML file. Then only the `-f` command-line option is required for the exporter to
196201
point at the file.
197202

198-
An example configuration file is provided in each exporter's directory. All of the exporters support
203+
All of the exporters support
199204
the same configuration options for how to connect to MQ and which objects are monitored. There is
200205
then an exporter-specific section for additional configuration such as how to contact the back-end
201206
database.
207+
The common options are shown in a template in this directory; the exporter-specific options are in individual files in each directory. Combine the two pieces into a single file to get a complete deployable configuration.
202208

203209
Unlike the command line flags, lists are provided in a more natural format instead of comma-separated
204210
values in a single string. If an option is provided on both the command line and in the file, it is the file

buildInDocker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ do
5757
then
5858
cp $srcdir/*.mqsc $GOPATH/bin
5959
fi
60-
if [ -r $srcdir/$m.yaml ]
60+
if [ -r $srcdir/config.collector.yaml ]
6161
then
62-
cp $srcdir/*.yaml $GOPATH/bin
62+
cat ./config.common.yaml $srcdir/config.collector.yaml > $GOPATH/bin/$m.yaml
6363
fi
6464

6565
done

cmd/mq_aws/config.collector.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# This is the collector-specific portion of the configuration
3+
cloudwatch:
4+
region: eu-west-1
5+
interval: 60s
6+
maxErrors: 10
7+
maxPoints: 20
8+
namespace: "IBM/MQ"
9+

cmd/mq_aws/exporter.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func Collect() error {
110110
pollStatus := false
111111
thisPoll := time.Now()
112112
elapsed := thisPoll.Sub(lastPoll)
113-
if elapsed >= config.cf.PollIntervalDuration {
113+
if elapsed >= config.cf.PollIntervalDuration || first {
114114
log.Debugf("Polling for object status")
115115
lastPoll = thisPoll
116116
pollStatus = true
@@ -192,12 +192,22 @@ func Collect() error {
192192
t := time.Now()
193193
bp := newBatchPoints()
194194

195+
// Start with a metric that shows how many publications were processed by this collection
196+
series = "qmgr"
197+
tags := map[string]string{
198+
"qmgr": config.cf.QMgrName,
199+
"platform": platformString,
200+
}
201+
pt, _ := newPoint(series+"."+"exporter_publications", t, float64(mqmetric.GetProcessPublicationCount()), tags)
202+
bp.addPoint(pt)
203+
log.Debugf("Adding point %v", pt)
204+
195205
for _, cl := range mqmetric.Metrics.Classes {
196206
for _, ty := range cl.Types {
197207
for _, elem := range ty.Elements {
198208
for key, value := range elem.Values {
199209
f := mqmetric.Normalise(elem, key, value)
200-
tags := map[string]string{
210+
tags = map[string]string{
201211
"qmgr": config.cf.QMgrName,
202212
"platform": platformString,
203213
}
@@ -221,6 +231,7 @@ func Collect() error {
221231
tags["description"] = mqmetric.GetObjectDescription(key, ibmmq.MQOT_Q)
222232
pt, _ := newPoint(series+"."+elem.MetricName, t, float64(f), tags)
223233
bp.addPoint(pt)
234+
log.Debugf("Adding point %v", pt)
224235

225236
// AWS recommends not sending too many
226237
// data points in a single request.
@@ -232,6 +243,7 @@ func Collect() error {
232243
}
233244
}
234245
}
246+
235247
series = "channel"
236248
for _, attr := range mqmetric.ChannelStatus.Attributes {
237249
for key, value := range attr.Values {

cmd/mq_aws/mq_aws.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

cmd/mq_coll/config.collector.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# This is the collector-specific portion of the configuration
3+
collectd:
4+
interval: 10s
5+
hostname: localhost

cmd/mq_coll/exporter.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func Collect() error {
6262
pollStatus := false
6363
thisPoll := time.Now()
6464
elapsed := thisPoll.Sub(lastPoll)
65-
if elapsed >= config.cf.PollIntervalDuration {
65+
if elapsed >= config.cf.PollIntervalDuration || first {
6666
log.Debugf("Polling for object status")
6767
lastPoll = thisPoll
6868
pollStatus = true
@@ -150,13 +150,20 @@ func Collect() error {
150150
// a misleading range on graphs.
151151
first = false
152152
} else {
153+
// Start with a metric that shows how many publications were processed by this collection
154+
series = "qmgr"
155+
tags := map[string]string{
156+
"qmgr": config.cf.QMgrName,
157+
"platform": platformString,
158+
}
159+
printPoint(series, "exporter_publications", float32(mqmetric.GetProcessPublicationCount()), tags)
153160

154161
for _, cl := range mqmetric.Metrics.Classes {
155162
for _, ty := range cl.Types {
156163
for _, elem := range ty.Elements {
157164
for key, value := range elem.Values {
158165
f := mqmetric.Normalise(elem, key, value)
159-
tags := map[string]string{
166+
tags = map[string]string{
160167
"qmgr": config.cf.QMgrName,
161168
}
162169

cmd/mq_coll/mq_coll.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)