Skip to content

Commit 693de1f

Browse files
authored
Merge pull request #48 from Cinimex-Informatica/feature/issue16_exporter_as_mq_service
issue16 Resolves: #16, fixes:#46
2 parents 25bf10e + c49edbc commit 693de1f

File tree

2 files changed

+60
-20
lines changed

2 files changed

+60
-20
lines changed

README.md

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Prometheus exporter for IBM MQ, written in Java. Exposes API of IBM MQ and syste
99
- [Dependencies](#dependencies)
1010
- [Configuration](#configuration)
1111
- [Build](#build)
12+
- [Run](#run)
13+
- [Running exporter as mq service](#running-exporter-as-mq-service)
14+
- [Running exporter as standalone java application](#running-exporter-as-standalone-java-application)
1215
2. [Metrics](#metrics)
1316
- [Platform central processing units](#platform-central-processing-units)
1417
- [CPU performance - platform wide](#cpu-performance---platform-wide)
@@ -119,9 +122,46 @@ channels:
119122
mvn package
120123
```
121124

122-
4. After processing is completed, go to mq-java-exporter/target. dependency-jars directory and webspheremq_exporter.jar should appear there.
123-
5. To run exporter, dependency-jars directory (and all jars in it) and mq_exporter.jar should be located in the same folder.
124-
6. To run exporter execute the following command:
125+
4. After processing is completed, go to mq-java-exporter/target. dependency-jars directory and mq_exporter.jar should appear there.
126+
127+
#### Run
128+
129+
To run exporter, dependency-jars directory (and all jars in it) and
130+
mq_exporter.jar should be located in the same folder.
131+
132+
##### Running exporter as mq service
133+
134+
It is recommended way of running the exporter. **Note**: all commands
135+
should be executed via MQ CLI. More info can be found [here](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.adm.doc/q083460_.htm).
136+
137+
Define queue manager service with the following command:
138+
139+
```mq
140+
DEFINE SERVICE(MQEXPORTER) CONTROL(QMGR) SERVTYPE(SERVER) +
141+
STARTCMD('/opt/mqm/java/jre64/jre/bin/java') +
142+
STARTARG('-Dlog4j.configurationFile=/opt/mq_exporter/log4j2.properties -jar /opt/mq_exporter/mq_exporter.jar /opt/mq_exporter/exporter_config.yaml') +
143+
STOPCMD('/usr/bin/kill ' ) STOPARG(+MQ_SERVER_PID+) +
144+
STDOUT('/opt/mq_exporter/mq_prometheus.out') +
145+
STDERR('/opt/mq_exporter/mq_prometheus.out') +
146+
DESCR('MQ exporter for Prometheus')
147+
```
148+
More information about this command can be found
149+
[here](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ref.adm.doc/q085740_.htm).
150+
151+
To start exporter, execute the following command:
152+
153+
```mq
154+
START SERVICE(MQEXPORTER)
155+
```
156+
157+
To stop exporter, execute the following command:
158+
159+
```mq
160+
STOP SERVICE(MQEXPORTER)
161+
```
162+
##### Running exporter as standalone java application
163+
164+
To run exporter execute the following command:
125165

126166
```shell
127167
java -jar mq_exporter.jar /opt/mq_exporter/exporter_config.yaml
@@ -191,7 +231,7 @@ The only input parameter is the path to your configuration file.
191231
<td><strong>Prometheus metric name</strong></td>
192232
<td><strong>Metric type</strong></td>
193233
<td><strong>Short description</strong></td>
194-
<td><strong>MQ metric elemen</strong></td>
234+
<td><strong>MQ metric element</strong></td>
195235
</tr>
196236
<tr>
197237
<td>mq_cpu_user_cpu_time_estimate_percentage</td>
@@ -222,7 +262,7 @@ The only input parameter is the path to your configuration file.
222262
<td><strong>Prometheus metric name</strong></td>
223263
<td><strong>Metric type</strong></td>
224264
<td><strong>Short description</strong></td>
225-
<td><strong>MQ metric elemen</strong></td>
265+
<td><strong>MQ metric element</strong></td>
226266
</tr>
227267
<tr>
228268
<td>mq_disk_trace_file_system_in_use_megabytes</td>
@@ -264,7 +304,7 @@ The only input parameter is the path to your configuration file.
264304
<td><strong>Prometheus metric name</strong></td>
265305
<td><strong>Metric type</strong></td>
266306
<td><strong>Short description</strong></td>
267-
<td><strong>MQ metric elemen</strong></td>
307+
<td><strong>MQ metric element</strong></td>
268308
</tr>
269309
<tr>
270310
<td>mq_disk_file_system_in_use_megabytes</td>
@@ -288,7 +328,7 @@ The only input parameter is the path to your configuration file.
288328
<td><strong>Prometheus metric name</strong></td>
289329
<td><strong>Metric type</strong></td>
290330
<td><strong>Short description</strong></td>
291-
<td><strong>MQ metric elemen</strong></td>
331+
<td><strong>MQ metric element</strong></td>
292332
</tr>
293333
<tr>
294334
<td>mq_rlog_log_bytes_in_use_bytes</td>
@@ -343,7 +383,7 @@ The only input parameter is the path to your configuration file.
343383
<td><strong>Prometheus metric name</strong></td>
344384
<td><strong>Metric type</strong></td>
345385
<td><strong>Short description</strong></td>
346-
<td><strong>MQ metric elemen</strong></td>
386+
<td><strong>MQ metric element</strong></td>
347387
</tr>
348388
<tr>
349389
<td>mq_mqconn_mqconnx_count_totalcalls</td>
@@ -379,7 +419,7 @@ The only input parameter is the path to your configuration file.
379419
<td><strong>Prometheus metric name</strong></td>
380420
<td><strong>Metric type</strong></td>
381421
<td><strong>Short description</strong></td>
382-
<td><strong>MQ metric elemen</strong></td>
422+
<td><strong>MQ metric element</strong></td>
383423
</tr>
384424
<tr>
385425
<td>mq_mqopen_mqopen_count_totalcalls</td>
@@ -415,7 +455,7 @@ The only input parameter is the path to your configuration file.
415455
<td><strong>Prometheus metric name</strong></td>
416456
<td><strong>Metric type</strong></td>
417457
<td><strong>Short description</strong></td>
418-
<td><strong>MQ metric elemen</strong></td>
458+
<td><strong>MQ metric element</strong></td>
419459
</tr>
420460
<tr>
421461
<td>mq_mqinq_mqinq_count_totalcalls</td>
@@ -451,7 +491,7 @@ The only input parameter is the path to your configuration file.
451491
<td><strong>Prometheus metric name</strong></td>
452492
<td><strong>Metric type</strong></td>
453493
<td><strong>Short description</strong></td>
454-
<td><strong>MQ metric elemen</strong></td>
494+
<td><strong>MQ metric element</strong></td>
455495
</tr>
456496
<tr>
457497
<td>mq_put_interval_total_mqput_mqput1_count_totalcalls</td>
@@ -529,7 +569,7 @@ The only input parameter is the path to your configuration file.
529569
<td><strong>Prometheus metric name</strong></td>
530570
<td><strong>Metric type</strong></td>
531571
<td><strong>Short description</strong></td>
532-
<td><strong>MQ metric elemen</strong></td>
572+
<td><strong>MQ metric element</strong></td>
533573
</tr>
534574
</tr>
535575
<tr>
@@ -644,7 +684,7 @@ The only input parameter is the path to your configuration file.
644684
<td><strong>Prometheus metric name</strong></td>
645685
<td><strong>Metric type</strong></td>
646686
<td><strong>Short description</strong></td>
647-
<td><strong>MQ metric elemen</strong></td>
687+
<td><strong>MQ metric element</strong></td>
648688
</tr>
649689
</tr>
650690
<tr>
@@ -669,7 +709,7 @@ The only input parameter is the path to your configuration file.
669709
<td><strong>Prometheus metric name</strong></td>
670710
<td><strong>Metric type</strong></td>
671711
<td><strong>Short description</strong></td>
672-
<td><strong>MQ metric elemen</strong></td>
712+
<td><strong>MQ metric element</strong></td>
673713
</tr>
674714
</tr>
675715
<tr>
@@ -766,7 +806,7 @@ The only input parameter is the path to your configuration file.
766806
<td><strong>Prometheus metric name</strong></td>
767807
<td><strong>Metric type</strong></td>
768808
<td><strong>Short description</strong></td>
769-
<td><strong>MQ metric elemen</strong></td>
809+
<td><strong>MQ metric element</strong></td>
770810
</tr>
771811
<tr>
772812
<td>mq_publish_topic_mqput_mqput1_interval_total_totalmessages</td>
@@ -821,7 +861,7 @@ The only input parameter is the path to your configuration file.
821861
<td><strong>Prometheus metric name</strong></td>
822862
<td><strong>Metric type</strong></td>
823863
<td><strong>Short description</strong></td>
824-
<td><strong>MQ metric elemen</strong></td>
864+
<td><strong>MQ metric element</strong></td>
825865
</tr>
826866
<tr>
827867
<td>mqobject_mqopen_mqopen_count_totalcalls</td>
@@ -845,7 +885,7 @@ The only input parameter is the path to your configuration file.
845885
<td><strong>Prometheus metric name</strong></td>
846886
<td><strong>Metric type</strong></td>
847887
<td><strong>Short description</strong></td>
848-
<td><strong>MQ metric elemen</strong></td>
888+
<td><strong>MQ metric element</strong></td>
849889
</tr>
850890
<td>mqobject_mqinq_mqinq_count_totalcalls</td>
851891
<td>counter</td>
@@ -868,7 +908,7 @@ The only input parameter is the path to your configuration file.
868908
<td><strong>Prometheus metric name</strong></td>
869909
<td><strong>Metric type</strong></td>
870910
<td><strong>Short description</strong></td>
871-
<td><strong>MQ metric elemen</strong></td>
911+
<td><strong>MQ metric element</strong></td>
872912
</tr>
873913
<tr>
874914
<td>mqobject_put_mqput_mqput1_count_totalcalls</td>
@@ -946,7 +986,7 @@ The only input parameter is the path to your configuration file.
946986
<td><strong>Prometheus metric name</strong></td>
947987
<td><strong>Metric type</strong></td>
948988
<td><strong>Short description</strong></td>
949-
<td><strong>MQ metric elemen</strong></td>
989+
<td><strong>MQ metric element</strong></td>
950990
</tr>
951991
<tr>
952992
<td>mqobject_get_mqget_count_totalcalls</td>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<configuration>
7575
<excludes>
7676
<exclude>**/exporter_config.yaml</exclude>
77-
<exclude>**/log4j.properties</exclude>
77+
<exclude>**/log4j2.properties</exclude>
7878
</excludes>
7979
<archive>
8080
<manifest>

0 commit comments

Comments
 (0)