<commit_before>[![Build Status](https://travis-ci.org/CSC-IT-Center-for-Science/ansible-role-collectd.svg)](https://travis-ci.org/CSC-IT-Center-for-Science/ansible-role-collectd)
ansible-role-collectd
=========

Configures a collectd with a few roles

Requirements
------------

/etc/collectd.d/ directory

Role Variables
--------------

Example for how to add more plugins and how to configure them when using the apache encoder style.

Dependencies
------------

Some ideas borrowed from https://github.com/picotrading/ansible-collectd and that role uses the apache\_encoder\_macro.j2 from picotrading - 

<pre>
https://raw.githubusercontent.com/picotrading/config-encoder-macros/master/macros/apache_encode_macro.j2
</pre>

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:<commit_msg>Add an example config to the README<commit_after>[![Build Status](https://travis-ci.org/CSC-IT-Center-for-Science/ansible-role-collectd.svg)](https://travis-ci.org/CSC-IT-Center-for-Science/ansible-role-collectd)
ansible-role-collectd
=========

Configures a collectd with a few roles

Requirements
------------

/etc/collectd.d/ directory

Role Variables
--------------

Example for how to add more plugins and how to configure them when using the apache encoder style.

Want to configure collectd to ship metrics with the collectd protocol with a username/password and set graphite prefix? Set this:

<pre>
collectd_tsdb_writer: False
collectd_network_server: True
collectd_set_graphite_prefix: True
collectd_graphite_prefix_1: "^hpc\\.jade\\."
collectd_graphite_prefix_2: "hpc.jade."

collectd_plugins_processes: ""
collectd_plugins_network:
  - options:
    - LoadPlugin: network
  - sections:
    - name: Plugin
      param: network
      content:
        - options:
          - Forward: True
        - sections:
          - name: Server
            param: "{{ collectd_network_server_host }}"
            content:
              - options:
                - SecurityLevel: Encrypt
                - Username: "{{ collectd_username }}"
                - Password: "{{ collectd_password }}"
#
collectd_plugins_custom: "{{
  collectd_plugins_aggregation +
  collectd_plugins_cpufreq +
  collectd_plugins_exec +
  collectd_plugins_network
}}"

</pre>

Dependencies
------------

Some ideas borrowed from https://github.com/picotrading/ansible-collectd and that role uses the apache\_encoder\_macro.j2 from picotrading - 

<pre>
https://raw.githubusercontent.com/picotrading/config-encoder-macros/master/macros/apache_encode_macro.j2
</pre>

Example Playbook
----------------

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
{'fraction_non_alphanumeric': 0.1320754716981132, 'fraction_numerical': 0.002135991456034176, 'mean_word_length': 3.1568047337278107, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '389542', 'n_tokens_mistral': 870, 'n_tokens_neox': 830, 'n_words': 219}