code: def _run_check(self):
          
          cmd = shlex.split(self.config['check_cmd'])
          self.log.info("running %s", ' '.join(cmd))
          proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE)
  
          start_time = time.time()
          try:
              outs, errs = proc.communicate(timeout=self.config['check_timeout'])
          except subprocess.TimeoutExpired:
              self.log.error("check timed out")
              if proc.poll() is None:
                  try:
                      proc.kill()
                  except PermissionError:
                      self.log.warning("failed to kill check due to adequate "
                                       "access rights, check could be running "
                                       "under another user(root) via sudo")
  
              return False
          else:
              msg = "check duration {t:.3f}ms".format(
                  t=(time.time() - start_time) * 1000)
              self.log.info(msg)
  
              if proc.returncode != 0:
                  self.log.info("stderr from the check %s", errs)
                  self.log.info("stdout from the check %s", outs)
  
              return proc.returncode == 0
docs: Execute a check command.
  
          Returns:
              True if the exit code of the command is 0 otherwise False.