def generate_jmx_configs(agentConfig, hostname, checknames=None):
 from jmxfetch import JMX_CHECKS
 if (not checknames):
  checknames = JMX_CHECKS
 agentConfig['checksd_hostname'] = hostname
 generated = {}
 for (check_name, service_disco_check_config) in _service_disco_configs(agentConfig).iteritems():
  if ((check_name in checknames) and (check_name in JMX_CHECKS)):
   log.debug(('Generating JMX config for: %s' % check_name))
   (sd_init_config, sd_instances) = service_disco_check_config
   check_config = {'init_config': sd_init_config, 'instances': sd_instances}
   try:
    yaml = config_to_yaml(check_config)
    generated['{}_{}'.format(check_name, 0)] = yaml
    log.debug('YAML generated: %s', yaml)
   except Exception:
    log.exception('Unable to generate YAML config for %s', check_name)
 return generated

def generate_jmx_configs ( agentConfig , hostname , checknames = None ) : from jmxfetch import JMX_CHECKS if ( not checknames ) : checknames = JMX_CHECKS agentConfig [ 'checksd_hostname' ] = hostname generated = { } for ( check_name , service_disco_check_config ) in _service_disco_configs ( agentConfig ) . iteritems ( ) : if ( ( check_name in checknames ) and ( check_name in JMX_CHECKS ) ) : log . debug ( ( 'Generating JMX config for: %s' % check_name ) ) ( sd_init_config , sd_instances ) = service_disco_check_config check_config = { 'init_config' : sd_init_config , 'instances' : sd_instances } try : yaml = config_to_yaml ( check_config ) generated [ '{}_{}' . format ( check_name , 0 ) ] = yaml log . debug ( 'YAML generated: %s' , yaml ) except Exception : log . exception ( 'Unable to generate YAML config for %s' , check_name ) return generated
similar logic to load_check_directory for jmx checks .