Skip to content

Commit

Permalink
Merge pull request #1 from tokyowizard/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
tokyowizard authored Aug 2, 2017
2 parents f1dde3e + 27f37bc commit b185bf6
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 30 deletions.
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ To include a plugin, set any variables you need for it, then add it to the `libr
* `mysql`
* `redis`
* `haproxy`
* `interface`

## Usage

Expand Down Expand Up @@ -91,6 +92,25 @@ To use your own custom or upstream collectd plugin, simply have another module d

The password to use for password-protected status pages. Defaults to empty.

### Plugin: `df`
- `librato_df_fstype`

**Type**: array

The FSType to use. Defaults to `["ext2", "ext3", "ext4", "xfs", "jfs", "btrfs", "reiserfs", "vboxsf", "tmpfs"]`.

- `librato_df_device`

**Type**: array

The Device to use. Defaults to `''`

- `librato_df_mountpoint`

**Type**: array

The MountPoint to use. Defaults to `''`

### Plugin: `docker`
- `librato_docker_protocol`

Expand All @@ -108,7 +128,7 @@ To use your own custom or upstream collectd plugin, simply have another module d

**Type**: string

The Docker port. Defaults to `2735`
The Docker port. Defaults to `2375`

### Plugin: `elasticsearch`

Expand Down Expand Up @@ -155,6 +175,10 @@ To use your own custom or upstream collectd plugin, simply have another module d

The default proxies to collect. Defaults to `server`, `frontend`, `backend`.

### Plugin: `interface`

Interface has no configurable attributes.

### Plugin: `jvm`
- `librato_jvm_host`

Expand Down Expand Up @@ -443,61 +467,61 @@ To use your own custom or upstream collectd plugin, simply have another module d

The global plugin polling interval in seconds. Defaults to `60`.

- `librato_use_log_file`
- `librato_logging_use_log_file`

**Type**: true/false

Write collectd logs to a file. Defaults to `true`.

- `librato_use_syslog`
- `librato_logging_use_syslog`

**Type**: true/false

Write collectd logs to syslog. Defaults to `false`.

- `librato_use_logstash`
- `librato_logging_use_logstash`

**Type**: true/false

Write collectd logs to a logstash-formatted file. Defaults to `false`.

- `librato_log_file_log_level`
- `librato_logging_log_file_log_level`

**Type**: string

The log level to use for `log_file`. Defaults to `info`.

- `librato_log_file_filename`
- `librato_logging_log_file_filename`

**Type**: string

The filename to use for `log_file`. Defaults to `/opt/collectd/var/log/collectd.log`.

- `librato_log_file_timestamp`
- `librato_logging_log_file_timestamp`

**Type**: true/false

Use timestamps in the log file or not. Defaults to `true`.

- `librato_log_file_print_severity`
- `librato_logging_log_file_print_severity`

**Type**: true/false

Include severity levels in the log file or not. Defaults to `true`.

- `librato_syslog_log_level`
- `librato_logging_syslog_log_level`

**Type**: string

The log level to use for `syslog`. Defaults to `info`.

- `librato_logstash_log_level`
- `librato_logging_logstash_log_level`

**Type**: string

The log level to use for `logstash`. Defaults to `info`.

- `librato_logstash_filename`
- `librato_logging_logstash_filename`

**Type**: string

Expand All @@ -507,7 +531,7 @@ To use your own custom or upstream collectd plugin, simply have another module d

**Type**: array

A list of default plugins to include. Defaults to: `cpu`, `df`, `disk`, `swap`, `memory`, `load`.
A list of default plugins to include. Defaults to: `cpu`, `disk`, `swap`, `memory`, `load`.

- `librato_enabled_plugins`

Expand Down
8 changes: 6 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ librato_config_base: '/opt/collectd/etc'
librato_plugin_config_path: '/opt/collectd/etc/collectd.conf.d'
librato_fqdn_lookup: true
librato_interval: 60
librato_default_plugins: ['cpu', 'df', 'disk', 'swap', 'memory', 'load']
librato_default_plugins: ['cpu', 'disk', 'swap', 'memory', 'load']
librato_enabled_plugins: []

librato_logging_use_log_file: true
Expand Down Expand Up @@ -66,8 +66,12 @@ librato_postgresql_user: 'postgresql'

librato_docker_protocol: 'http'
librato_docker_host: 'localhost'
librato_docker_port: '2735'
librato_docker_port: '2375'

librato_jvm_host: 'localhost'
librato_jvm_service_url: 'service:jmx:rmi:///jndi/rmi://localhost:17264/jmxrmi'
librato_jvm_mbeans: []

librato_df_fstype: ["ext2", "ext3", "ext4", "xfs", "jfs", "btrfs", "reiserfs", "vboxsf", "tmpfs"]
librato_df_device: ''
librato_df_mountpoint: ''
15 changes: 0 additions & 15 deletions files/df.conf

This file was deleted.

1 change: 1 addition & 0 deletions tasks/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
yum:
name: collectd-core-{{ librato_rh_version }}
state: present
enablerepo: epel
notify:
- collectd
when:
Expand Down
19 changes: 19 additions & 0 deletions templates/df.conf.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
LoadPlugin df
<Plugin df>
{% if librato_df_mountpoint|length > 0 %}
{% for mountpoint in librato_df_mountpoint %}
MountPoint "{{ mountpoint }}"
{% endfor %}
{% endif %}
{% if librato_df_device|length > 0 %}{% for device in librato_df_device %}
Device "{{ device }}"
{% endfor %}
{% endif %}
{% if librato_df_fstype|length > 0 %}{% for fstype in librato_df_fstype %}
FSType "{{ fstype }}"
{% endfor %}
{% endif %}
ReportInodes false
ValuesAbsolute false
ValuesPercentage true
</Plugin>
5 changes: 5 additions & 0 deletions templates/interface.conf.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
LoadPlugin interface
<Plugin "interface">
Interface "lo"
IgnoreSelected true
</Plugin>
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/docker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
describe file('/opt/collectd/etc/collectd.conf.d/docker.conf') do
it { should exist }
it { should contain 'LoadPlugin exec' }
it { should contain 'Exec "nobody" "/opt/collectd/share/collectd/collectd-docker.py" "http://localhost:2735"' }
it { should contain 'Exec "nobody" "/opt/collectd/share/collectd/collectd-docker.py" "http://localhost:2375"' }
end

0 comments on commit b185bf6

Please sign in to comment.