(self, queue_manager, search_channel_name, tags, channels_to_skip=None)
Submit channel status

        Note: Error 3065 (MQRCCF_CHL_STATUS_NOT_FOUND) might indicate that the channel has not been used.
        More info: https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/fm16690_.htm

        :param search_channel_name might contain wildcard characters
Submit channel status
Submit channel status
def _submit_channel_status(self, queue_manager, search_channel_name, tags, channels_to_skip=None):
        """Submit channel status

        Note: Error 3065 (MQRCCF_CHL_STATUS_NOT_FOUND) might indicate that the channel has not been used.
        More info: https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.doc/fm16690_.htm

        :param search_channel_name might contain wildcard characters
        """
        channels_to_skip = channels_to_skip or []
        search_channel_tags = tags + ["channel:{}".format(search_channel_name)]
        try:
            args = {pymqi.CMQCFC.MQCACH_CHANNEL_NAME: pymqi.ensure_bytes(search_channel_name)}
            pcf = pymqi.PCFExecute(
                queue_manager, response_wait_interval=self.config.timeout, convert=self.config.convert_endianness
            )
            response = pcf.MQCMD_INQUIRE_CHANNEL_STATUS(args)
            self.service_check(self.CHANNEL_SERVICE_CHECK, AgentCheck.OK, search_channel_tags)
        except pymqi.MQMIError as e:
            if e.comp == pymqi.CMQC.MQCC_FAILED and e.reason == pymqi.CMQCFC.MQRCCF_CHL_STATUS_NOT_FOUND:
                self.service_check(self.CHANNEL_SERVICE_CHECK, AgentCheck.CRITICAL, search_channel_tags)
                self.log.debug("Channel status not found for channel %s: %s", search_channel_name, e)
            elif e.comp == pymqi.CMQC.MQCC_FAILED and e.reason == pymqi.CMQC.MQRC_NO_MSG_AVAILABLE:
                self.service_check(self.CHANNEL_SERVICE_CHECK, AgentCheck.UNKNOWN, search_channel_tags)
                self.log.debug("There are no messages available for channel %s", search_channel_name)
            else:
                self.service_check(self.CHANNEL_SERVICE_CHECK, AgentCheck.CRITICAL, search_channel_tags)
                self.log.warning("Error getting CHANNEL status for channel %s: %s", search_channel_name, e)
        else:
            for channel_info in response:
                channel_name = to_string(channel_info[pymqi.CMQCFC.MQCACH_CHANNEL_NAME]).strip()
                if channel_name in channels_to_skip:
                    continue
                channel_tags = tags + ["channel:{}".format(channel_name)]

                self._submit_metrics_from_properties(channel_info, metrics.channel_status_metrics(), channel_tags)

                channel_status = channel_info[pymqi.CMQCFC.MQIACH_CHANNEL_STATUS]
                self._submit_channel_count(channel_name, channel_status, channel_tags)
                self._submit_status_check(channel_name, channel_status, channel_tags)
def _submit_channel_status ( self , queue_manager , search_channel_name , tags , channels_to_skip = None ) : channels_to_skip = channels_to_skip or [ ] search_channel_tags = tags + [ "channel:{}" . format ( search_channel_name ) ] try : args = { pymqi . CMQCFC . MQCACH_CHANNEL_NAME : pymqi . ensure_bytes ( search_channel_name ) } pcf = pymqi . PCFExecute ( queue_manager , response_wait_interval = self . config . timeout , convert = self . config . convert_endianness ) response = pcf . MQCMD_INQUIRE_CHANNEL_STATUS ( args ) self . service_check ( self . CHANNEL_SERVICE_CHECK , AgentCheck . OK , search_channel_tags ) except pymqi . MQMIError as e : if e . comp == pymqi . CMQC . MQCC_FAILED and e . reason == pymqi . CMQCFC . MQRCCF_CHL_STATUS_NOT_FOUND : self . service_check ( self . CHANNEL_SERVICE_CHECK , AgentCheck . CRITICAL , search_channel_tags ) self . log . debug ( "Channel status not found for channel %s: %s" , search_channel_name , e ) elif e . comp == pymqi . CMQC . MQCC_FAILED and e . reason == pymqi . CMQC . MQRC_NO_MSG_AVAILABLE : self . service_check ( self . CHANNEL_SERVICE_CHECK , AgentCheck . UNKNOWN , search_channel_tags ) self . log . debug ( "There are no messages available for channel %s" , search_channel_name ) else : self . service_check ( self . CHANNEL_SERVICE_CHECK , AgentCheck . CRITICAL , search_channel_tags ) self . log . warning ( "Error getting CHANNEL status for channel %s: %s" , search_channel_name , e ) else : for channel_info in response : channel_name = to_string ( channel_info [ pymqi . CMQCFC . MQCACH_CHANNEL_NAME ] ) . strip ( ) if channel_name in channels_to_skip : continue channel_tags = tags + [ "channel:{}" . format ( channel_name ) ] self . _submit_metrics_from_properties ( channel_info , metrics . channel_status_metrics ( ) , channel_tags ) channel_status = channel_info [ pymqi . CMQCFC . MQIACH_CHANNEL_STATUS ] self . _submit_channel_count ( channel_name , channel_status , channel_tags ) self . _submit_status_check ( channel_name , channel_status , channel_tags )