code: def get_daemon_stats(self, details=False):  # pylint: disable=unused-argument
          
          res = self.get_id()
          res.update({
              "program_start": self.program_start,
              "spare": self.spare,
              'counters': {},
              'metrics': [],
              'modules': {
                  'internal': {}, 'external': {}
              }
          })
  
          # Modules information
          modules = res['modules']
          counters = res['counters']
          counters['modules'] = len(self.modules_manager.instances)
          # first get data for all internal modules
          for instance in self.modules_manager.get_internal_instances():
              state = {True: 'ok', False: 'stopped'}[(instance
                                                      not in self.modules_manager.to_restart)]
              modules['internal'][instance.name] = {'name': instance.name, 'state': state}
          # Same but for external ones
          for instance in self.modules_manager.get_external_instances():
              state = {True: 'ok', False: 'stopped'}[(instance
                                                      not in self.modules_manager.to_restart)]
              modules['internal'][instance.name] = {'name': instance.name, 'state': state}
  
          return res
docs: Get state of modules and create a scheme for stats data of daemon
          This may be overridden in subclasses (and it is...)
  
          :return: A dict with the following structure
          ::
              {
                  'modules': {
                      'internal': {'name': "MYMODULE1", 'state': 'ok'},
                      'external': {'name': "MYMODULE2", 'state': 'stopped'},
                  },
                  And some extra information, see the source code below...
              }
  
          These information are completed with the data provided by the get_id function
          which provides the daemon identification
  
          :rtype: dict