Skip to content

Commit 44e1f1e

Browse files
committed
Add the script to startup the collector for the MQ Bridge for Salesforce
Update README to match.
1 parent 124dd80 commit 44e1f1e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

cmd/mq_prometheus/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ To use the dashboard,
2020
create a data source in Grafana called "MQ Prometheus" that points at your
2121
database server, and then import the JSON file.
2222

23+
There is also a script to start the collector so that it processes
24+
the statistics generated by the MQ Bridge for Salesforce, included in
25+
MQ V9.0.2
26+
2327

2428
## Building
2529
* This github repository contains the monitoring program and

cmd/mq_prometheus/mqsf_prometheus.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
# This is used to start the IBM MQ monitoring service for Prometheus
4+
# to collect data from the MQ Bridge for Salesforce.
5+
6+
# The queue manager name comes in from the service definition as the
7+
# only command line parameter
8+
qMgr=$1
9+
10+
# Set the environment to ensure we pick up libmqm.so etc
11+
. /opt/mqm/bin/setmqenv -m $qMgr -k
12+
13+
# A list of topics to be monitored is given here. Can use specific topics
14+
# or MQ wildcards such as "#". We are still using a "queues" command line
15+
# parameter, and ought to change it, but this works.
16+
queues="#,/topic/PT1,/topic/PT2,/event/PE2__e,/event/PE1__e"
17+
18+
# See config.go for all recognised flags
19+
20+
# Start via "exec" so the pid remains the same. The queue manager can
21+
# then check the existence of the service and use the MQ_SERVER_PID value
22+
# to kill it on shutdown.
23+
# Need to specify an HTTP port that is not currently used. The default 9157 may
24+
# be used by the collector accessing queue manager resource statistics.
25+
exec /usr/local/bin/mqgo/mq_prometheus -ibmmq.queueManager=$qMgr -ibmmq.monitoredQueues="$queues" -log.level=error -metaPrefix="\$SYS/Application/runmqsfb" -ibmmq.httpListenPort=9158

cmd/mq_prometheus/prometheus.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ scrape_configs:
3737

3838
static_configs:
3939
- targets: ['hostname.example.com:9157']
40+
# targets: ['hostname.example.com:9157','hostname.example.com:9158'] is
41+
# the syntax if you want to have several prometheus monitors on the same
42+
# box.

0 commit comments

Comments
 (0)