'Run JMXFetch
redirect_std_streams: if left to False, the stdout and stderr of JMXFetch are streamed
directly to the environment\'s stdout and stderr and cannot be retrieved via python\'s
sys.stdout and sys.stderr. Set to True to redirect these streams to python\'s sys.stdout
and sys.stderr.'

def run(self, command=None, checks_list=None, reporter=None, redirect_std_streams=False):

    if (checks_list or (self.jmx_checks is None)):
        self.configure(checks_list)
    try:
        command = (command or JMX_COLLECT_COMMAND)
        if (len(self.invalid_checks) > 0):
            try:
                JMXFiles.write_status_file(self.invalid_checks)
            except Exception:
                log.exception('Error    while    writing    JMX    status    file')
        if ((len(self.jmx_checks) > 0) or self.service_discovery):
            return self._start(self.java_bin_path, self.java_options, self.jmx_checks, command, reporter, self.tools_jar_path, self.custom_jar_paths, redirect_std_streams)
        else:
            time.sleep(4)
            log.info('No    valid    JMX    integration    was    found.    Exiting    ...')
    except Exception:
        log.exception('Error    while    initiating    JMXFetch')
        raise
