Exemple #1
0
def monitor_programs(config):
    programs = merge_multiple_settings(
        redis_program('log_buffer', config.log_buffer_redis_host, config.log_buffer_redis_port),
        {'elasticsearch': {
            'run_in_directory': '/usr/share/elasticsearch',
            'execute_command': '/usr/share/elasticsearch/bin/elasticsearch -Epath.conf={}/elasticsearch'.format(VEIL_ETC_DIR),
            'run_as': 'elasticsearch',
            'environment_variables': {'ES_JVM_OPTIONS': VEIL_ETC_DIR / 'elasticsearch/jvm.options'},
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }},
        {'logstash': {
            'run_in_directory': '/usr/share/logstash',
            'execute_command': '/usr/share/logstash/bin/logstash --path.settings {}/logstash'.format(VEIL_ETC_DIR),
            'run_as': 'logstash',
            'environment_variables': {'HOME': os.environ.copy().get('HOME')},
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }},
        {'kibana': {
            'run_in_directory': '/usr/share/kibana',
            'execute_command': '/usr/share/kibana/bin/kibana --host {}'.format(config.kibana_host),
            'run_as': 'kibana',
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }}
    )
    return programs
Exemple #2
0
def monitor_programs(config):
    programs = merge_multiple_settings(
        redis_program('log_buffer', config.log_buffer_redis_host, config.log_buffer_redis_port,
                      snapshot_configs=[DictObject(interval=interval, changed_keys=changed_keys) for interval, changed_keys in
                                        [(900, 1), (300, 10), (60, 10000)]], recursive=True),
        {'elasticsearch': {
            'environment_variables': {'ES_HEAP_SIZE': config.es_heap_size},
            'run_in_directory': '/usr/share/elasticsearch',
            'execute_command': '/usr/share/elasticsearch/bin/elasticsearch -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.conf=/etc/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch',
            'run_as': 'elasticsearch',
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }},
        {'logstash': {
            'environment_variables': {'LS_HEAP_SIZE': config.ls_heap_size},
            'run_in_directory': '/var/lib/logstash',
            'execute_command': '/opt/logstash/bin/logstash agent -f /etc/logstash/conf.d --allow-unsafe-shutdown',
            'run_as': 'logstash',
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }},
        {'kibana': {
            'run_in_directory': '/opt/kibana',
            'execute_command': '/opt/kibana/bin/kibana',
            'run_as': 'kibana',
            'resources': [('veil.environment.monitor.elk_resource', {'config': config})]
        }}
    )
    return programs
Exemple #3
0
def monitor_programs(config):
    programs = merge_multiple_settings(
        redis_program('log_buffer',
                      config.log_buffer_redis_host,
                      config.log_buffer_redis_port,
                      snapshot_configs=[
                          DictObject(interval=interval,
                                     changed_keys=changed_keys)
                          for interval, changed_keys in [(900,
                                                          1), (300,
                                                               10), (60,
                                                                     10000)]
                      ],
                      recursive=True),
        {
            'elasticsearch': {
                'run_in_directory':
                '/usr/share/elasticsearch',
                'execute_command':
                '/usr/share/elasticsearch/bin/elasticsearch -Epath.conf={}/elasticsearch'
                .format(VEIL_ETC_DIR),
                'run_as':
                'elasticsearch',
                'environment_variables': {
                    'ES_JVM_OPTIONS':
                    VEIL_ETC_DIR / 'elasticsearch/jvm.options'
                },
                'resources': [('veil.environment.monitor.elk_resource', {
                    'config': config
                })]
            }
        }, {
            'logstash': {
                'run_in_directory':
                '/usr/share/logstash',
                'execute_command':
                '/usr/share/logstash/bin/logstash --path.settings {}/logstash'.
                format(VEIL_ETC_DIR),
                'run_as':
                'logstash',
                'environment_variables': {
                    'HOME': os.environ.copy().get('HOME')
                },
                'resources': [('veil.environment.monitor.elk_resource', {
                    'config': config
                })]
            }
        }, {
            'kibana': {
                'run_in_directory':
                '/usr/share/kibana',
                'execute_command':
                '/usr/share/kibana/bin/kibana --host {}'.format(
                    config.kibana_host),
                'run_as':
                'kibana',
                'resources': [('veil.environment.monitor.elk_resource', {
                    'config': config
                })]
            }
        })
    return programs
Exemple #4
0
def queue_program(host, port):
    return objectify({
        'queue': redis_program('queue', host, port, persisted_by_aof=True).queue_redis
    })