---
title: "Ansible collectd"
author: "phoenix"
date: 2022-06-29T15:16:39+02:00

---
The [geekoops-collectd role](https://github.com/GeekOops/geekoops-collectd) is an Ansible role to install and configure `collectd` on an openSUSE Leap server. The role contains many configuration parameter with which you can enable a large set of [collectd plugins](https://www.collectd.org/wiki/index.php/Table_of_Plugins).

Currently the plugin supports pushing to an InfluxDB server or setting up a prometheus webserver for metrics scraping.

Most common plugins have been considered for the role, but the state is not yet complete. If you miss a certain plugin, feel free to [create a pull request](https://github.com/GeekOops/geekoops-collectd/pulls) or [report it as an issue](https://github.com/GeekOops/geekoops-collectd/issues).

# Example

The following example enables collectd on the `jellyfish` server and pushed the metrics to the InfluxDB host on 192.168.122.3. In addition to the default plugins (cpu, uptime, load, memory, swap) we also want to report metrics from `df` about the disk stats, from the local APC, additional vmem information and the `hddtemp` stats.

```yaml
---
- hosts: jellyfish
  user: root
  
  roles:
     - role: geekoops-collectd
       vars:
        influx_host: "192.168.122.3"
        enable_df: true
        enable_apcups: true
        enable_vmem: true
        enable_hddtemp: true
```
