Returns IOpipe configuration options, setting defaults as necessary.
973010
def set_config(**config):
    
    config.setdefault("debug", bool(strtobool(os.getenv("IOPIPE_DEBUG", "false"))))
    config.setdefault("enabled", bool(strtobool(os.getenv("IOPIPE_ENABLED", "true"))))
    config.setdefault("host", get_hostname())
    config.setdefault("install_method", os.getenv("IOPIPE_INSTALL_METHOD", "manual"))
    config.setdefault("network_timeout", os.getenv("IOPIPE_NETWORK_TIMEOUT", 5000))
    config.setdefault("path", get_collector_path())
    config.setdefault("plugins", [])
    config.setdefault("sync_http", False)
    config.setdefault("timeout_window", os.getenv("IOPIPE_TIMEOUT_WINDOW", 500))
    config.setdefault(
        "token", os.getenv("IOPIPE_TOKEN") or os.getenv("IOPIPE_CLIENTID") or ""
    )

    if "client_id" in config:
        config["token"] = config.pop("client_id")

    if "url" in config:
        url = config.pop("url")

        config["host"] = get_hostname(url)
        config["path"] = get_collector_path(url)

    if "." in str(config["network_timeout"]):
        warnings.warn(
            "IOpipe's 'network_timeout' is now in milliseconds, expressed as an integer"
        )

    try:
        config["debug"] = bool(config["debug"])
    except ValueError:
        config["debug"] = False

    try:
        config["network_timeout"] = int(config["network_timeout"]) / 1000.0
    except ValueError:
        config["network_timeout"] = 5.0

    if "." in str(config["timeout_window"]):
        warnings.warn(
            "IOpipe's 'timeout_window' is now in milliseconds, expressed as an integer"
        )

    try:
        config["timeout_window"] = int(config["timeout_window"]) / 1000.0
    except ValueError:
        config["timeout_window"] = 0.5

    return config
1330222
def _opts_defaults(self, **kwargs):
        '''
        
        '''
        # Let's start with the default salt cloud configuration
        opts = salt.config.DEFAULT_CLOUD_OPTS.copy()
        # Update it with the loaded configuration
        opts.update(self.opts.copy())
        # Reset some of the settings to sane values
        opts['parallel'] = False
        opts['keep_tmp'] = False
        opts['deploy'] = True
        opts['update_bootstrap'] = False
        opts['show_deploy_args'] = False
        opts['script_args'] = ''
        # Update it with the passed kwargs
        if 'kwargs' in kwargs:
            opts.update(kwargs['kwargs'])
        opts.update(kwargs)
        profile = opts.get('profile', None)
        # filter other profiles if one is specified
        if profile:
            tmp_profiles = opts.get('profiles', {}).copy()
            for _profile in [a for a in tmp_profiles]:
                if not _profile == profile:
                    tmp_profiles.pop(_profile)
            # if profile is specified and we have enough info about providers
            # also filter them to speedup methods like
            # __filter_non_working_providers
            providers = [a.get('provider', '').split(':')[0]
                         for a in six.itervalues(tmp_profiles)
                         if a.get('provider', '')]
            if providers:
                _providers = opts.get('providers', {})
                for provider in _providers.copy():
                    if provider not in providers:
                        _providers.pop(provider)
        return opts
825959
def get_default_config(self):
        
        config = super(ResqueWebCollector, self).get_default_config()
        config.update({
            'host': 'localhost',
            'port': 5678,
            'path': 'resqueweb',
        })
        return config
58491
def get_default_config(self):
        
        config = super(InfluxdbHandler, self).get_default_config()

        config.update({
            'hostname': 'localhost',
            'port': 8086,
            'ssl': False,
            'username': 'root',
            'password': 'root',
            'database': 'graphite',
            'batch_size': 1,
            'cache_size': 20000,
            'time_precision': 's',
        })

        return config
555503
def get_default_config(self):
        
        config = super(SquidCollector, self).get_default_config()
        config.update({
            'hosts': ['localhost:3128'],
            'path': 'squid',
        })
        return config
1190963
def get_default_config(self):
        
        config = super(ProcessStatCollector, self).get_default_config()
        config.update({
            'path':     'proc'
        })
        return config
1052734
def get_default_config(self):
        
        config = super(EximCollector, self).get_default_config()
        config.update({
            'path':            'exim',
            'bin':              '/usr/sbin/exim',
            'use_sudo':         False,
            'sudo_cmd':         '/usr/bin/sudo',
            'sudo_user':        'root',
        })
        return config
1329058
def get_default_config(self):
        
        config = super(NetworkCollector, self).get_default_config()
        config.update({
            'path':         'network',
            'interfaces':   ['eth', 'bond', 'em', 'p1p', 'eno', 'enp', 'ens',
                             'enx'],
            'byte_unit':    ['bit', 'byte'],
            'greedy':       'true',
        })
        return config
115270
def get_default_config(self):
        
        config = super(NfsdCollector, self).get_default_config()
        config.update({
            'path':     'nfsd'
        })
        return config
1314546
def get_default_config(self):
        
        config = super(OneWireCollector, self).get_default_config()
        config.update({
            'path': 'owfs',
            'owfs': '/mnt/1wire',
            # 'scan': {'temperature': 't'},
            # 'id:24.BB000000': {'file_with_value': 'alias'},
        })
        return config
1140967
def get_default_config(self):
        
        default_config = super(SNMPInterfaceCollector,
                               self).get_default_config()
        default_config['path'] = 'interface'
        default_config['byte_unit'] = ['bit', 'byte']
        return default_config
678041
def find_existing_configs(self, default):
        '''
        
        '''
        configs = []
        for cfg in [default, self._config_filename_, 'minion', 'proxy', 'cloud', 'spm']:
            if not cfg:
                continue
            config_path = self.get_config_file_path(cfg)
            if os.path.exists(config_path):
                configs.append(cfg)

        if default and default not in configs:
            raise SystemExit('Unknown configuration unit: {}'.format(default))

        return configs
205440
def get_default_config(self):
        
        config = super(NtpCollector, self).get_default_config()
        config.update({
            'bin':      self.find_binary('/usr/sbin/ntpdate'),
            'ntp_pool': 'pool.ntp.org',
            'path':     'ntp',
            'precision': 0,
            'time_scale': 'milliseconds',
        })
        return config
912749
def get_default_config(self):
        
        config = super(OpenLDAPCollector, self).get_default_config()
        config.update({
            'path': 'openldap',
            'host': 'localhost',
            'port': 389,
            'username': 'cn=monitor',
            'password': 'password',
        })
        return config
164575
def get_default_config(self):
        
        config = super(MonitCollector, self).get_default_config()
        config.update({
            'host':         '127.0.0.1',
            'port':         2812,
            'user':         'monit',
            'passwd':       'monit',
            'path':         'monit',
            'byte_unit':    ['byte'],
            'send_totals':  False,
        })
        return config
1200063
def get_default_config(self):
        
        config = super(zmqHandler, self).get_default_config()

        config.update({
            'port': 1234,
        })

        return config
1132289
def get_default_config(self):
        
        config = super(TCPCollector, self).get_default_config()
        config.update({
            'path': 'tcp',
            'allowed_names':
                'ListenOverflows, ListenDrops, TCPLoss, ' +
                'TCPTimeouts, TCPFastRetrans, TCPLostRetransmit, ' +
                'TCPForwardRetrans, TCPSlowStartRetrans, CurrEstab, ' +
                'TCPAbortOnMemory, TCPBacklogDrop, AttemptFails, ' +
                'EstabResets, InErrs, ActiveOpens, PassiveOpens',
            'gauges': 'CurrEstab, MaxConn',
        })
        return config