def get_program_status_brok(self, brok_type='program_status'):
        """Create a program status brok

        Initially builds the running properties and then, if initial status brok,
        get the properties from the Config class where an entry exist for the brok
        'full_status'

        :return: Brok with program status data
        :rtype: alignak.brok.Brok
        """
        # Get the running statistics
        data = {
            "is_running": True,
            "instance_id": self.instance_id,
            # "alignak_name": self.alignak_name,
            "instance_name": self.name,
            "last_alive": time.time(),
            "pid": os.getpid(),
            '_running': self.get_scheduler_stats(details=True),
            '_config': {},
            '_macros': {}
        }

        # Get configuration data from the pushed configuration
        cls = self.pushed_conf.__class__
        for prop, entry in list(cls.properties.items()):
            # Is this property intended for broking?
            if 'full_status' not in entry.fill_brok:
                continue
            data['_config'][prop] = self.pushed_conf.get_property_value_for_brok(
                prop, cls.properties)
            # data['_config'][prop] = getattr(self.pushed_conf, prop, entry.default)

        # Get the macros from the pushed configuration and try to resolve
        # the macros to provide the result in the status brok
        macro_resolver = MacroResolver()
        macro_resolver.init(self.pushed_conf)
        for macro_name in sorted(self.pushed_conf.macros):
            data['_macros'][macro_name] = \
                macro_resolver.resolve_simple_macros_in_string("$%s$" % macro_name,
                                                               [], None, None)

        logger.debug("Program status brok %s data: %s", brok_type, data)
        return Brok({'type': brok_type, 'data': data})
def get_program_status_brok ( self , brok_type = 'program_status' ) : data = { "is_running" : True , "instance_id" : self . instance_id , "instance_name" : self . name , "last_alive" : time . time ( ) , "pid" : os . getpid ( ) , '_running' : self . get_scheduler_stats ( details = True ) , '_config' : { } , '_macros' : { } } cls = self . pushed_conf . __class__ for prop , entry in list ( cls . properties . items ( ) ) : if 'full_status' not in entry . fill_brok : continue data [ '_config' ] [ prop ] = self . pushed_conf . get_property_value_for_brok ( prop , cls . properties ) macro_resolver = MacroResolver ( ) macro_resolver . init ( self . pushed_conf ) for macro_name in sorted ( self . pushed_conf . macros ) : data [ '_macros' ] [ macro_name ] = macro_resolver . resolve_simple_macros_in_string ( "$%s$" % macro_name , [ ] , None , None ) logger . debug ( "Program status brok %s data: %s" , brok_type , data ) return Brok ( { 'type' : brok_type , 'data' : data } )
Create a program status brok

        Initially builds the running properties and then, if initial status brok,
        get the properties from the Config class where an entry exist for the brok
        'full_status'

        :return: Brok with program status data
        :rtype: alignak.brok.Brok