code: def collect(self):
          
          perfdata_dir = self.config['perfdata_dir']
  
          try:
              filenames = os.listdir(perfdata_dir)
          except OSError:
              self.log.error("Cannot read directory `{dir}'".format(
                  dir=perfdata_dir))
              return
  
          for filename in filenames:
              self._process_file(os.path.join(perfdata_dir, filename))
docs: Collect statistics from a Nagios perfdata directory.