@@ -158,6 +158,16 @@ func Collect(c client.Client) error {
158158 log .Debugf ("Collected all AMQP status" )
159159 }
160160 }
161+
162+ if config .cf .MonitoredMQTTChannels != "" {
163+ err = mqmetric .CollectMQTTChannelStatus (config .cf .MonitoredMQTTChannels )
164+ if err != nil {
165+ log .Errorf ("Error collecting MQTT status: %v" , err )
166+ pollError = err
167+ } else {
168+ log .Debugf ("Collected all MQTT status" )
169+ }
170+ }
161171 }
162172
163173 err = mqmetric .CollectQueueManagerStatus ()
@@ -180,7 +190,8 @@ func Collect(c client.Client) error {
180190 _ = mqmetric .RediscoverAndSubscribe (discoverConfig )
181191 lastQueueDiscovery = thisDiscovery
182192 _ = mqmetric .RediscoverAttributes (ibmmq .MQOT_CHANNEL , config .cf .MonitoredChannels )
183- err = mqmetric .RediscoverAttributes (mqmetric .OT_CHANNEL_AMQP , config .cf .MonitoredAMQPChannels )
193+ _ = mqmetric .RediscoverAttributes (mqmetric .OT_CHANNEL_AMQP , config .cf .MonitoredAMQPChannels )
194+ _ = mqmetric .RediscoverAttributes (mqmetric .OT_CHANNEL_MQTT , config .cf .MonitoredMQTTChannels )
184195
185196 }
186197 }
@@ -283,6 +294,10 @@ func Collect(c client.Client) error {
283294 connName := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL ).Attributes [mqmetric .ATTR_CHL_CONNNAME ].Values [key ].ValueString
284295 jobName := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL ).Attributes [mqmetric .ATTR_CHL_JOBNAME ].Values [key ].ValueString
285296
297+ cipherSpec := mqmetric .DUMMY_STRING
298+ if cipherSpecAttr , ok := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL ).Attributes [mqmetric .ATTR_CHL_SSLCIPH ].Values [key ]; ok {
299+ cipherSpec = cipherSpecAttr .ValueString
300+ }
286301 tags := map [string ]string {
287302 "qmgr" : config .cf .QMgrName ,
288303 }
@@ -292,6 +307,8 @@ func Collect(c client.Client) error {
292307 tags [mqmetric .ATTR_CHL_RQMNAME ] = strings .TrimSpace (rqmName )
293308 tags [mqmetric .ATTR_CHL_CONNNAME ] = strings .TrimSpace (connName )
294309 tags [mqmetric .ATTR_CHL_JOBNAME ] = strings .TrimSpace (jobName )
310+ tags [mqmetric .ATTR_CHL_SSLCIPH ] = strings .TrimSpace (cipherSpec )
311+
295312 addMetaLabels (tags )
296313
297314 f := mqmetric .ChannelNormalise (attr , value .ValueInt64 )
@@ -545,6 +562,36 @@ func Collect(c client.Client) error {
545562 }
546563 }
547564 }
565+
566+ series = "mqtt"
567+ for _ , attr := range mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL_MQTT ).Attributes {
568+ qMgrName := strings .TrimSpace (config .cf .QMgrName )
569+
570+ for key , value := range attr .Values {
571+ chlName := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL_MQTT ).Attributes [mqmetric .ATTR_CHL_NAME ].Values [key ].ValueString
572+ clientId := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL_MQTT ).Attributes [mqmetric .ATTR_CHL_MQTT_CLIENT_ID ].Values [key ].ValueString
573+ connName := mqmetric .GetObjectStatus ("" , mqmetric .OT_CHANNEL_MQTT ).Attributes [mqmetric .ATTR_CHL_CONNNAME ].Values [key ].ValueString
574+ if value .IsInt64 && ! attr .Pseudo {
575+ tags := map [string ]string {
576+ "qmgr" : qMgrName ,
577+ "platform" : platformString ,
578+ }
579+ tags ["channel" ] = chlName
580+ tags ["description" ] = mqmetric .GetObjectDescription (chlName , mqmetric .OT_CHANNEL_MQTT )
581+ tags [mqmetric .ATTR_CHL_CONNNAME ] = strings .TrimSpace (connName )
582+ tags [mqmetric .ATTR_CHL_MQTT_CLIENT_ID ] = clientId
583+ addMetaLabels (tags )
584+
585+ f := mqmetric .ChannelNormalise (attr , value .ValueInt64 )
586+
587+ fields := map [string ]interface {}{attr .MetricName : f }
588+
589+ pt := client .NewPoint (series , tags , fields , t )
590+ bp .WritePoint (pt )
591+ log .Debugf ("Adding pageset point %v" , pt )
592+ }
593+ }
594+ }
548595 }
549596
550597 }
0 commit comments