Skip to content

Commit

Permalink
Updated READEME and NPE fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BalakrishnaV committed Jun 4, 2018
1 parent ff11b72 commit aa5e2e7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Use case
Websphere MQ, formerly known as MQ (message queue) series, is an IBM standard for program-to-program messaging across multiple platforms.

The WebSphere MQ monitoring extension can monitor multiple queues managers and their resources, namely queues, topics, channels and listeners.
The WebSphere MQ monitoring extension can monitor multiple queues managers and their resources, namely queues, topics, channels and listeners The metrics are extracted out using the [PCF command messages](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q020010_.htm).

The metrics for queue manager, queue, topic, channel and listener can be configured.

Expand Down Expand Up @@ -269,7 +269,7 @@ Configure the monitor by editing the config.yml file in <code><machine-agent-dir
```

### Extension Working - Internals
This extension extracts metrics through [PCF framework](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q019990_.htm). A complete list of PCF commands are listed [here] (https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086870_.htm)
This extension extracts metrics through [PCF framework](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q019990_.htm). A complete list of PCF commands are listed [here](https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q086870_.htm)
Each queue manager has an administration queue with a standard queue name and the extension sends PCF command messages to that queue. On Windows and Unix platforms, the PCF commands are sent is always sent to the SYSTEM.ADMIN.COMMAND.QUEUE queue.
More details about that is mentioned [here](https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q020010_.htm)

Expand Down Expand Up @@ -515,7 +515,7 @@ Always feel free to fork and contribute any changes directly via [GitHub](https:
|IBM MQ Version tested On |7.x, 8.x, 9.x and Windows, Unix, AIX|
|Last Update |21st May, 2018 |

List of Changes to this extension can be found [here](https://github.com/Appdynamics/websphere-mq-monitoring-extension/blob/v7.0/CHANGELOG.md)
List of Changes to this extension can be found [here](https://github.com/Appdynamics/websphere-mq-monitoring-extension/blob/master/CHANGELOG.md)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public ListenerMetricsCollector(Map<String, WMQMetricOverride> metricsToReport,
this.countDownLatch = countDownLatch;
}


@Override
public void run() {
try {
this.process();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public QueueMetricsCollector(Map<String, WMQMetricOverride> metricsToReport, Mon
this.countDownLatch = countDownLatch;
}

@Override
public void run() {
try {
this.process();
Expand Down Expand Up @@ -137,21 +136,25 @@ protected void processPCFRequestAndPublishQMetrics(String queueGenericName, PCFM
WMQMetricOverride wmqOverride = getMetricsToReport().get(metrickey);
try{
PCFParameter pcfParam = response[i].getParameter(wmqOverride.getConstantValue());
if(pcfParam instanceof MQCFIN){
int metricVal = response[i].getIntParameterValue(wmqOverride.getConstantValue());
Metric metric = createMetric(metrickey, metricVal, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey);
metrics.add(metric);
}
else if(pcfParam instanceof MQCFIL){
int[] metricVals = response[i].getIntListParameterValue(wmqOverride.getConstantValue());
if(metricVals != null){
int count=0;
for(int val : metricVals){
count++;
Metric metric = createMetric(metrickey+ "_" + Integer.toString(count), val, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey+ "_" + Integer.toString(count));
metrics.add(metric);
if (pcfParam != null) {
if(pcfParam instanceof MQCFIN){
int metricVal = response[i].getIntParameterValue(wmqOverride.getConstantValue());
Metric metric = createMetric(metrickey, metricVal, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey);
metrics.add(metric);
}
else if(pcfParam instanceof MQCFIL){
int[] metricVals = response[i].getIntListParameterValue(wmqOverride.getConstantValue());
if(metricVals != null){
int count=0;
for(int val : metricVals){
count++;
Metric metric = createMetric(metrickey+ "_" + Integer.toString(count), val, wmqOverride, queueManager.getName(), getAtrifact(), queueName, metrickey+ "_" + Integer.toString(count));
metrics.add(metric);
}
}
}
} else {
logger.warn("PCF parameter is null in response for Queue: {} for metric: {} in command {}", queueName, wmqOverride.getIbmCommand(),command);
}
}
catch (PCFException pcfe) {
Expand All @@ -165,6 +168,5 @@ else if(pcfParam instanceof MQCFIL){
logger.debug("Queue name {} is excluded.",queueName);
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public TopicMetricsCollector(Map<String, WMQMetricOverride> metricsToReport, Mon
this.countDownLatch = countDownLatch;
}

@Override
public void run() {
try {
this.process();
Expand Down

0 comments on commit aa5e2e7

Please sign in to comment.