This is not a place where to store collectd plugins. It can:
- get_url of a remote file (and check checksum)
- copy of a local file, perhaps available in files/
- configre the plugin if it's a python plugin or run through exec
a list of checks
Example for setting up an iostat exec and some ceph python check copied from the ansible repo:
collectd_plugin_exec_plugins: - { path: "../files/iostat_collectd_plugin.rb", name: "iostat_collectd_plugin.rb", user: "nobody:nobody", command: "/usr/local/collectd/plugins/iostat_collectd_plugin.rb" } collectd_plugin_python_plugins: - { path: "../files/ceph_collectd/__init__.py", directory: "ceph", name: "__init__.py" } - { path: "../files/ceph_collectd/base.py", directory: "ceph", name: "base.py" } - { path: "../files/ceph_collectd/ceph_latency_plugin.py", directory: "ceph", name: "ceph_latency_plugin.py", import: "ceph_latency_plugin", module_config: [ { "Verbose": "True", "Cluster": "ceph", "Interval": "60" } ] } - { path: "../files/ceph_collectd/ceph_monitor_plugin.py", directory: "ceph", name: "ceph_monitor_plugin.py", import: "ceph_monitor_plugin", module_config: [ { "Verbose": "True", "Cluster": "ceph", "Interval": "60" }] } - { path: "../files/ceph_collectd/ceph_osd_plugin.py", directory: "ceph", name: "ceph_osd_plugin.py", import: "ceph_osd_plugin", module_config: [ { "Verbose": "True", "Cluster": "ceph", "Interval": "60" }] } - { path: "../files/ceph_collectd/ceph_pg_plugin.py", directory: "ceph", name: "ceph_pg_plugin.py", import: "ceph_pg_plugin", module_config: [ { "Verbose": "True", "Cluster": "ceph", "Interval": "60" }] } - { path: "../files/ceph_collectd/ceph_pool_plugin.py", directory: "ceph", name: "ceph_pool_plugin.py", import: "ceph_pool_plugin", module_config: [ { "Verbose": "True", "Cluster": "ceph", "Interval": "60", "TestPool": "test" } ] }
https://github.com/CSCfi/ansible-role-collectd
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: ansible-role-collectd }
- { role: ansible-role-collectd-plugins }
MIT