Skip to content

Commit

Permalink
added files for Collectd 5.6 support (#10)
Browse files Browse the repository at this point in the history
* refactor to support Collectd v5.4 - v5.6
  • Loading branch information
tokyowizard authored and MiLk committed Oct 18, 2016
1 parent 701d889 commit 925ac8f
Show file tree
Hide file tree
Showing 23 changed files with 185 additions and 2,973 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,25 @@ collectd1.somedc.prod ansible_ssh_host=10.0.1.111 private_ip=172.16.1.

### Plugin configuration

The `collectd_plugins` variable defines the plugins to be loaded. Default plugins are below:

```
- syslog
- cpu
- interface
- load
- memory
- vmem
- swap
- disk
- rrdtool
- network
- librato
- exec
- write_graphite
```


#### [Disk](https://collectd.org/wiki/index.php/Plugin:Disk)


Expand Down
15 changes: 15 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ collectd_forward_to_logstash: false
use_librato: false
use_graphite: false

collectd_plugins:
- syslog
- cpu
- interface
- load
- memory
- vmem
- swap
- disk
- rrdtool
- network
- librato
- exec
- write_graphite

packages:
- git
- collectd
Expand Down
2 changes: 1 addition & 1 deletion files/coretemp.modules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec /sbin/modprobe coretemp >/dev/null 2>&1
exec /sbin/modprobe coretemp >/dev/null 2>&1
23 changes: 5 additions & 18 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,19 @@
- files
- configs

- name: "Upload df plugin config"
- name: "Upload plugin configs"
template: >
src=df.conf.j2
dest={{ collectd_d_config_dir }}/df.conf
src=plugin-configs/{{ item }}.conf.j2
dest={{ collectd_d_config_dir }}/{{ item }}.conf
mode=0644
with_items: collectd_plugins
notify:
- Restart collectd
tags:
- collectd
- files
- configs

- name: "Upload Librato collectd config"
template: >
src=librato.conf.{{ installed_version }}.j2
dest=/etc/collectd.d/librato.conf
owner=root
group=root
mode=0644
when: use_librato|bool and collectd_forwarder is defined and collectd_forwarder == inventory_hostname
notify:
- Restart collectd
tags:
- collectd
- libs

- name: "Install coretemp plugin for collectd"
copy: >
src=collectd-coretemp.sh
Expand All @@ -65,7 +52,7 @@

- name: "Install /etc/collectd.conf"
template: >
src=collectd.conf.{{ installed_version }}.j2
src=collectd.conf.j2
dest={{ collectd_config_dest }}
mode=0644
notify:
Expand Down
Loading

0 comments on commit 925ac8f

Please sign in to comment.