@@ -379,60 +379,60 @@ func (e *exporter) Collect(ch chan<- prometheus.Metric) {
379379 log .Debugf ("Collected all queue status" )
380380 }
381381 }
382- }
383-
384- if err == nil {
385- err = mqmetric .CollectQueueManagerStatus ()
386- if err != nil {
387- log .Errorf ("Error collecting queue manager status: %v" , err )
388- pollError = err
389- } else {
390- log .Debugf ("Collected all queue manager status" )
391- }
392- }
393-
394- if err == nil {
395- err = mqmetric .CollectClusterStatus ()
396- if err != nil {
397- log .Errorf ("Error collecting cluster status: %v" , err )
398- pollError = err
399- } else {
400- log .Debugf ("Collected all cluster status" )
401- }
402- }
403382
404- if err == nil && mqmetric .GetPlatform () == ibmmq .MQPL_ZOS {
405- err = mqmetric .CollectUsageStatus ()
406- if err != nil {
407- log .Errorf ("Error collecting bufferpool/pageset status: %v" , err )
408- pollError = err
409- } else {
410- log .Debugf ("Collected all buffer pool/pageset status" )
383+ if err == nil {
384+ err = mqmetric .CollectQueueManagerStatus ()
385+ if err != nil {
386+ log .Errorf ("Error collecting queue manager status: %v" , err )
387+ pollError = err
388+ } else {
389+ log .Debugf ("Collected all queue manager status" )
390+ }
411391 }
412- }
413392
414- if err == nil && mqmetric .GetPlatform () != ibmmq .MQPL_ZOS {
415- if config .cf .MonitoredAMQPChannels != "" {
416- err = mqmetric .CollectAMQPChannelStatus (config .cf .MonitoredAMQPChannels )
393+ if err == nil {
394+ err = mqmetric .CollectClusterStatus ()
417395 if err != nil {
418- log .Errorf ("Error collecting AMQP channel status: %v" , err )
396+ log .Errorf ("Error collecting cluster status: %v" , err )
419397 pollError = err
420398 } else {
421- log .Debugf ("Collected all AMQP channel status" )
399+ log .Debugf ("Collected all cluster status" )
422400 }
423401 }
424402
425- if config . cf . MonitoredMQTTChannels != "" {
426- err = mqmetric .CollectMQTTChannelStatus ( config . cf . MonitoredMQTTChannels )
403+ if err == nil && mqmetric . GetPlatform () == ibmmq . MQPL_ZOS {
404+ err = mqmetric .CollectUsageStatus ( )
427405 if err != nil {
428- log .Errorf ("Error collecting MQTT channel status: %v" , err )
406+ log .Errorf ("Error collecting bufferpool/pageset status: %v" , err )
429407 pollError = err
430408 } else {
431- log .Debugf ("Collected all MQTT channel status" )
409+ log .Debugf ("Collected all buffer pool/pageset status" )
432410 }
433411 }
434- }
435412
413+ if err == nil && mqmetric .GetPlatform () != ibmmq .MQPL_ZOS {
414+ if config .cf .MonitoredAMQPChannels != "" {
415+ err = mqmetric .CollectAMQPChannelStatus (config .cf .MonitoredAMQPChannels )
416+ if err != nil {
417+ log .Errorf ("Error collecting AMQP channel status: %v" , err )
418+ pollError = err
419+ } else {
420+ log .Debugf ("Collected all AMQP channel status" )
421+ }
422+ }
423+
424+ if config .cf .MonitoredMQTTChannels != "" {
425+ err = mqmetric .CollectMQTTChannelStatus (config .cf .MonitoredMQTTChannels )
426+ if err != nil {
427+ log .Errorf ("Error collecting MQTT channel status: %v" , err )
428+ pollError = err
429+ } else {
430+ log .Debugf ("Collected all MQTT channel status" )
431+ }
432+ }
433+ }
434+
435+ }
436436 }
437437 if err == nil {
438438 err = pollError
0 commit comments