Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
236 lines (232 sloc) 7.13 KB
{% set os_map = salt['grains.filter_by']({
'Debian': {
'config': '/etc/collectd/collectd.conf',
'javalib': '/usr/lib/collectd/java.so',
'pkg': 'collectd-core',
'plugindirconfig': '/etc/collectd/plugins',
'service': 'collectd',
'TypesDB': ['/usr/share/collectd/types.db'],
'moduledirconfig': '/usr/share/collectd/modules',
'user': 'root',
'group': 'root',
},
'RedHat': {
'config': '/etc/collectd.conf',
'pkg': 'collectd',
'plugindirconfig': '/etc/collectd.d',
'service': 'collectd',
'TypesDB': ['/usr/share/collectd/types.db'],
'moduledirconfig': '/usr/share/collectd/modules',
'user': 'root',
'group': 'root',
},
'FreeBSD': {
'config': '/usr/local/etc/collectd.conf',
'pkg': 'collectd5',
'plugindirconfig': '/usr/local/etc/collectd.d',
'service': 'collectd',
'TypesDB': ['/usr/local/share/collectd/types.db'],
'moduledirconfig': '/usr/local/share/collectd/modules',
'user': 'root',
'group': 'wheel',
},
}, merge=salt['pillar.get']('collectd:lookup')) %}
{# Settings dictionary with default values #}
{% set default_settings = {
'collectd': {
'Hostname': salt['grains.get']('fqdn'),
'Interval': 10,
'Timeout': 2,
'ReadThreads': 5,
'WriteQueueLimitHigh': 2000000,
'WriteQueueLimitLow': 1800000,
'CollectInternalStats': 'false',
'FQDNLookup': 'false',
'purge_plugindir': 'false',
'enable_service': true,
'plugins': {
'default': [
'battery',
'cpu',
'entropy',
'load',
'memory',
'swap',
'users'
],
'extra': {},
'apache': {
'instances' : [ {
'name': 'name',
'url': 'http://' + salt['grains.get']('host') + '/server-status?auto',
'verifypeer': 'false',
'verifyhost': 'false',
'server': 'apache'
}
]
},
'bind': {
'proto': 'http',
'host': 'localhost',
'port': '8053',
'parsetime': true,
'opcodes': true,
'qtypes': true,
'serverstats': true,
'zonemaintstats': true,
'resolverstats': false,
'memorystats': true,
},
'csv': {
'DataDir': '/var/lib/collectd/csv',
'StoreRates': False
},
'df': {
'Devices': [],
'IgnoreSelected': 'false',
'ReportByDevice': 'false',
'ReportReserved': 'false',
'disable_report_reserved': 'false',
'ReportInodes': 'false',
'ValuesPercentage': 'false'
},
'disk': {
'matches': [],
'IgnoreSelected': 'false'
},
'ethstat': {
'interface': 'eth0'
},
'interface': {
'interfaces': ['eth0'],
'IgnoreSelected': 'false'
},
'java': {
'host': 'localhost',
'port': '17264',
},
'logfile': {
'log_level': 'warning',
'file': '/var/log/collectd.log',
'timestamp': true,
'print_severity': true,
},
'md': {
'Devices': [],
'IgnoreSelected': 'true'
},
'mysql': {
'databases': []
},
'network': {},
'nginx': {
'url': 'http://localhost/check_status',
},
'ntpd': {
'host': 'localhost',
'port': '123',
'ReverseLookups': 'false'
},
'memcached': {
'host': 'localhost',
'port': '11211',
},
'ping': {
'hosts': ['google.com', 'yahoo.com'],
'hosts_from_grains': {},
},
'postgresql': {
'databases': []
},
'powerdns': {
'socket': '/var/run/pdns.controlsocket'
},
'processes': {
'Processes': [],
'ProcessMatches': []
},
'protocols': {
'values_': [],
'IgnoreSelected': True,
},
'statsd': {
'host': '"::"',
'port': 8125
},
'syslog': {
'loglevel': 'info'
},
'write_graphite': {
'host': salt['grains.get']('fqdn'),
'port': 2003,
'prefix': 'collectd.',
'postfix': ''
},
'write_riemann': {
'host': salt['grains.get']('fqdn'),
'port': 5555,
'protocol': 'TCP',
'batch': True,
},
'python': {
'Globals': 'true',
'LogTraces': 'true',
'Interactive': 'false'
},
'elasticsearch': {
'host': 'localhost',
'port': 9200,
'cluster': 'elasticsearch',
'version': '1.0',
'verbose': 0
},
'redis_info': {
'host': 'localhost',
'port': 6379,
'verbose': 0
},
'rrdtool': {
'datadir': '/var/lib/collectd/rrd',
'cacheflush': 120,
'writespersecond': 50
},
'tcpconns': {
'listening_ports': 'true',
'local_ports': [],
'remote_ports': []
},
'unixsock': {
'socket_file': '/var/run/collectd.socket',
'socket_group': 'root',
'socket_perms': '0644',
'delete_socket': true,
},
'vmem': {
'verbose': 'false'
},
'openvpn': {
'status_file': [
'/var/log/openvpn/openvpn-status.log'
],
'individual_users': 'false',
'user_count': 'true',
'compression': 'false',
'improved_naming_scheme': 'true'
},
'rabbitmq': {
'host': 'localhost',
'port': 15672,
'username': 'guest',
'password': 'guest'
},
'zookeeper': {
'host': 'localhost',
'port': '2181'
}
}
}
} %}
{# Merge os_map into settings dictionary #}
{% do default_settings.collectd.update(os_map) %}
{# Update settings defaults from pillar data #}
{% set collectd_settings = salt['pillar.get']('collectd', default=default_settings.collectd, merge=True) %}