def load_check(agentConfig, hostname, checkname):
 from jmxfetch import JMX_CHECKS
 agentConfig['checksd_hostname'] = hostname
 osname = get_os()
 checks_places = get_checks_places(osname, agentConfig)
 for config_path in _file_configs_paths(osname, agentConfig):
  check_name = _conf_path_to_check_name(config_path)
  if ((check_name == checkname) and (check_name not in JMX_CHECKS)):
   (conf_is_valid, check_config, invalid_check) = _load_file_config(config_path, check_name, agentConfig)
   if (invalid_check and (not conf_is_valid)):
    return invalid_check
   (load_success, load_failure) = load_check_from_places(check_config, check_name, checks_places, agentConfig)
   return (load_success.values()[0] or load_failure)
 for (check_name, service_disco_check_config) in _service_disco_configs(agentConfig).iteritems():
  if (check_name == checkname):
   (sd_init_config, sd_instances) = service_disco_check_config[1]
   check_config = {'init_config': sd_init_config, 'instances': sd_instances}
   (load_success, load_failure) = load_check_from_places(check_config, check_name, checks_places, agentConfig)
   return (load_success.values()[0] or load_failure)
 return None

def load_check ( agentConfig , hostname , checkname ) : from jmxfetch import JMX_CHECKS agentConfig [ 'checksd_hostname' ] = hostname osname = get_os ( ) checks_places = get_checks_places ( osname , agentConfig ) for config_path in _file_configs_paths ( osname , agentConfig ) : check_name = _conf_path_to_check_name ( config_path ) if ( ( check_name == checkname ) and ( check_name not in JMX_CHECKS ) ) : ( conf_is_valid , check_config , invalid_check ) = _load_file_config ( config_path , check_name , agentConfig ) if ( invalid_check and ( not conf_is_valid ) ) : return invalid_check ( load_success , load_failure ) = load_check_from_places ( check_config , check_name , checks_places , agentConfig ) return ( load_success . values ( ) [ 0 ] or load_failure ) for ( check_name , service_disco_check_config ) in _service_disco_configs ( agentConfig ) . iteritems ( ) : if ( check_name == checkname ) : ( sd_init_config , sd_instances ) = service_disco_check_config [ 1 ] check_config = { 'init_config' : sd_init_config , 'instances' : sd_instances } ( load_success , load_failure ) = load_check_from_places ( check_config , check_name , checks_places , agentConfig ) return ( load_success . values ( ) [ 0 ] or load_failure ) return None
same logic as load_check_directory except it loads one specific check .