mirror of
https://github.com/GeekOops/geekoops-collectd.git
synced 2024-05-20 04:22:21 +00:00
Add more plugins
Add a bunch of new plugins that can be configured via this role.
This commit is contained in:
parent
e23d84bb22
commit
f13a0120ff
63
README.md
63
README.md
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
# geekoops-collectd
|
# geekoops-collectd
|
||||||
|
|
||||||
Easy ansible role to setup system metrics transmission to `collectd`.
|
Easy ansible role to setup system metrics transmission to `collectd`. This ansible role works with
|
||||||
Currently only `influxdb` is supported by this role. This ansible role works with
|
|
||||||
|
|
||||||
- openSUSE Leap 15.3
|
- openSUSE Leap 15.3
|
||||||
- openSUSE Leap 15.4
|
- openSUSE Leap 15.4
|
||||||
|
@ -13,20 +12,44 @@ Currently only `influxdb` is supported by this role. This ansible role works wit
|
||||||
|
|
||||||
| Value | Description | Default |
|
| Value | Description | Default |
|
||||||
|-------|-------------|---------|
|
|-------|-------------|---------|
|
||||||
|`nodename`| Name of the node that will be shown in grafana | "localhost" |
|
|`nodename`| Name of the node that will be shown in grafana | `{{ ansible_hostname }}` |
|
||||||
|`interval`| Report interval in seconds | 10 |
|
|`interval`| Report interval in seconds | `10` |
|
||||||
|`overwrite`| Overwrite existing `collectd.conf` file | false |
|
|`overwrite`| Overwrite existing `collectd.conf` file | `true` |
|
||||||
|`enable_influx`| Enable InfluxDB | false |
|
|`influx_host`| If set, collectd will push its metrics to this InfluxDB host | "" |
|
||||||
|`influx_host`| InfluxDB host | "127.0.0.1" |
|
|`influx_port`| InfluxDB post | `25826` |
|
||||||
|`influx_port`| InfluxDB post | 25826 |
|
|`prometheus_port`| If set, collectd will open a webserver of this port to accept scrape requests from Prometheus on this port | `""` |
|
||||||
|`enable_disk`| Enable disk plugin | true |
|
|`enable_disk`| Enable the disk plugin | `true` |
|
||||||
|`enable_cpu`| Enable CPU plugin | true |
|
|
||||||
|`enable_load`| Enable load plugin | true |
|
|
||||||
|`enable_memory`| Enable memory plugin | true |
|
|
||||||
|`enable_swap`| Enable swap plugin | true |
|
|
||||||
|`enable_df`| Enable df plugin | false |
|
|
||||||
|`disk_disks`| Disks added to the `disk` plugin | [] |
|
|`disk_disks`| Disks added to the `disk` plugin | [] |
|
||||||
|`df_disks`| Disks added to the `df` plugin | [] |
|
|`enable_cpu`| Enable the CPU plugin | `true` |
|
||||||
|
|`enable_uptime`| Enable the uptime plugin | `true` |
|
||||||
|
|`enable_cpufreq`| Enable the cpufreq plugin | `true` |
|
||||||
|
|`enable_load`| Enable the load plugin | `true` |
|
||||||
|
|`enable_memory`| Enable the memory plugin | `true` |
|
||||||
|
|`enable_swap`| Enable the swap plugin | `true` |
|
||||||
|
|`enable_smart`| Enable the smart plugin | `false` |
|
||||||
|
|`smart_disk` | Select disk(s) to be monitored by the smart plugin | `""` |
|
||||||
|
|`smart_use_serial` | Use the disk serial number instead of the kernel name to store data | `true` |
|
||||||
|
|`enable_df`| Enable the df plugin | `false` |
|
||||||
|
|`df_disks`| Disks added to the `df` plugin | `[]` |
|
||||||
|
|`enable_apcups`| Enable the apcups plugin | `false` |
|
||||||
|
|`apcups_host` | Hostname of the running `acpupsd` to query | `localhost` |
|
||||||
|
|`apcups_port` | Port to query | `3551` |
|
||||||
|
|`apcups_report_seconds` | Convert the lifetime to seconds | `true` |
|
||||||
|
|`apcups_persistent_connection` | Keep the connection between reads open | `true` |
|
||||||
|
|`enable_vmem`| Enable the vmem plugin | `false` |
|
||||||
|
|`vmem_verbose`| Report vmem stats verbosely | `false` |
|
||||||
|
|`enable_connectivity`| Enable the connectivity plugin to report if interfaces are up or down | `false` |
|
||||||
|
|`connectivity_interfaces`| Set the list of interfaces for the connectivity plugin to monitor | `[]` |
|
||||||
|
|`enable_battery` | Enable the battery plugin | `false` |
|
||||||
|
|`battery_percentage` | Report the battery stats as percentages | `true` |
|
||||||
|
|`battery_report_degraded` | Report the degraded stats instead the corrected-for-degraded stats | `false` |
|
||||||
|
|`enable_hddtemp` | Enable the hddtemp plugin | `false` |
|
||||||
|
|`hdd_temp_host` | Host to query by the plugin. This is where the hddtemp daemon is running | `127.0.0.1` |
|
||||||
|
|`hdd_temp_port` | Port of the hddtemp host to query | `7634` |
|
||||||
|
|`enable_md` | Enable the md plugin (RAID monitoring) | `false` |
|
||||||
|
|`md_device` | Device the md plugin should monitor | `/dev/md0` |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If `overwrite` is true, any existing `collectd.conf` file will be overwritten by ansible. Use this with caution! The existing configuration will only be written, if `collectd` is installed.
|
If `overwrite` is true, any existing `collectd.conf` file will be overwritten by ansible. Use this with caution! The existing configuration will only be written, if `collectd` is installed.
|
||||||
|
|
||||||
|
@ -43,15 +66,9 @@ Extended example
|
||||||
- role: geekoops-collectd
|
- role: geekoops-collectd
|
||||||
vars:
|
vars:
|
||||||
nodename: "jellyfish"
|
nodename: "jellyfish"
|
||||||
enable_influx: true
|
influx_host: "192.168.122.3"
|
||||||
influx_host: vinculum
|
enable_df: true
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|
||||||
## Author Information
|
|
||||||
|
|
||||||
phoenix
|
|
||||||
|
|
||||||
Have a lot of fun!
|
|
||||||
|
|
|
@ -1,32 +1,61 @@
|
||||||
---
|
---
|
||||||
# defaults file for geekoops-collectd
|
# defaults file for geekoops-collectd
|
||||||
|
|
||||||
nodename: "localhost"
|
nodename: "{{ ansible_hostname }}"
|
||||||
interval: 10
|
interval: 10
|
||||||
overwrite: false
|
overwrite: true
|
||||||
|
|
||||||
enable_influx: false
|
## Enable pushing of metrics to influxdb
|
||||||
influx_host: "127.0.0.1"
|
|
||||||
|
influx_host: ""
|
||||||
influx_port: 25826
|
influx_port: 25826
|
||||||
|
|
||||||
enable_prometheus: false
|
## Enable prometheus scrape webserver on this port
|
||||||
prometheus_port: "9103"
|
|
||||||
|
prometheus_port: ""
|
||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
enable_disk: true
|
enable_disk: true
|
||||||
enable_cpu: true
|
enable_cpu: true
|
||||||
|
enable_uptime: true
|
||||||
enable_cpufreq: false
|
enable_cpufreq: false
|
||||||
enable_load: true
|
enable_load: true
|
||||||
enable_memory: true
|
enable_memory: true
|
||||||
enable_swap: true
|
enable_swap: true
|
||||||
enable_smart: false
|
enable_smart: false
|
||||||
enable_df: false
|
enable_df: false
|
||||||
|
enable_apcups: false
|
||||||
|
enable_vmem: false
|
||||||
|
enable_connectivity: false
|
||||||
|
enable_battery: false
|
||||||
|
enable_hddtemp: false
|
||||||
|
enable_md: false
|
||||||
|
|
||||||
disk_disks: []
|
disk_disks: []
|
||||||
df_disks: []
|
df_disks: []
|
||||||
|
|
||||||
smart_disk: ""
|
smart_disk: ""
|
||||||
smart_use_serial: true
|
smart_use_serial: true
|
||||||
|
|
||||||
report_by_cpu: false
|
cpu_report_by_cpu: "false"
|
||||||
report_by_state: false
|
cpu_report_by_state: "false"
|
||||||
|
cpu_values_percentage: "true"
|
||||||
|
cpu_report_num_cpus: "false"
|
||||||
|
|
||||||
|
apcups_host: "localhost"
|
||||||
|
apcups_port: "3551"
|
||||||
|
apcups_report_seconds: "true"
|
||||||
|
apcups_persistent_connection: "true"
|
||||||
|
|
||||||
|
vmem_verbose: "false"
|
||||||
|
|
||||||
|
connectivity_interfaces: []
|
||||||
|
|
||||||
|
battery_percentage: "true"
|
||||||
|
battery_report_degraded: "false"
|
||||||
|
|
||||||
|
hdd_temp_host: "127.0.0.1"
|
||||||
|
hdd_temp_port: "7634"
|
||||||
|
|
||||||
|
md_device: "/dev/md0"
|
||||||
|
|
|
@ -37,5 +37,4 @@ verifier:
|
||||||
lint:
|
lint:
|
||||||
name: flake8
|
name: flake8
|
||||||
lint: |
|
lint: |
|
||||||
set -e
|
yamllint -d "{extends: relaxed, rules: {line-length: {max: 200}}}" .
|
||||||
yamllint .
|
|
||||||
|
|
|
@ -11,42 +11,20 @@ Hostname "{{ nodename }}"
|
||||||
AutoLoadPlugin true
|
AutoLoadPlugin true
|
||||||
Interval {{ interval }}
|
Interval {{ interval }}
|
||||||
|
|
||||||
LoadPlugin syslog
|
#LoadPlugin syslog
|
||||||
LoadPlugin cpu
|
#LoadPlugin cpu
|
||||||
#LoadPlugin cpufreq
|
#LoadPlugin cpufreq
|
||||||
{% if enable_cpufreq == true %}
|
{% if enable_cpufreq == true %}
|
||||||
LoadPlugin cpusleep
|
LoadPlugin cpusleep
|
||||||
{% else %}
|
|
||||||
#LoadPlugin cpusleep
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if enable_df == true %}
|
|
||||||
LoadPlugin df
|
|
||||||
{% else %}
|
|
||||||
#LoadPlugin df
|
|
||||||
{% endif %}
|
|
||||||
{% if enable_disk == true %}
|
|
||||||
LoadPlugin disk
|
|
||||||
{% else %}
|
|
||||||
#LoadPlugin disk
|
|
||||||
{% endif %}
|
|
||||||
#LoadPlugin hddtemp
|
|
||||||
#LoadPlugin hugepages
|
#LoadPlugin hugepages
|
||||||
LoadPlugin interface
|
LoadPlugin interface
|
||||||
#LoadPlugin ipmi
|
#LoadPlugin ipmi
|
||||||
{% if enable_load == true %}
|
|
||||||
LoadPlugin load
|
|
||||||
{% else %}
|
|
||||||
#LoadPlugin load
|
|
||||||
{% endif %}
|
|
||||||
#LoadPlugin md
|
|
||||||
{% if enable_memory == true %}
|
{% if enable_memory == true %}
|
||||||
LoadPlugin memory
|
LoadPlugin memory
|
||||||
{% else %}
|
|
||||||
#LoadPlugin memory
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
#LoadPlugin mysql
|
#LoadPlugin mysql
|
||||||
#LoadPlugin netlink
|
#LoadPlugin netlink
|
||||||
#LoadPlugin network
|
|
||||||
#LoadPlugin nfs
|
#LoadPlugin nfs
|
||||||
#LoadPlugin nginx
|
#LoadPlugin nginx
|
||||||
#LoadPlugin ntpd
|
#LoadPlugin ntpd
|
||||||
|
@ -59,42 +37,32 @@ LoadPlugin memory
|
||||||
#LoadPlugin rrdtool
|
#LoadPlugin rrdtool
|
||||||
#LoadPlugin sensors
|
#LoadPlugin sensors
|
||||||
#LoadPlugin serial
|
#LoadPlugin serial
|
||||||
|
|
||||||
{% if enable_smart == true and smart_disk != "" %}
|
|
||||||
#LoadPlugin smart
|
|
||||||
{% else %}
|
|
||||||
#LoadPlugin smart
|
|
||||||
{% endif %}
|
|
||||||
#LoadPlugin snmp
|
#LoadPlugin snmp
|
||||||
#LoadPlugin snmp_agent
|
#LoadPlugin snmp_agent
|
||||||
#LoadPlugin statsd
|
#LoadPlugin statsd
|
||||||
{% if enable_swap == true %}
|
|
||||||
LoadPlugin swap
|
|
||||||
{% else %}
|
|
||||||
#LoadPlugin swap
|
|
||||||
{% endif %}
|
|
||||||
#LoadPlugin thermal
|
#LoadPlugin thermal
|
||||||
|
{% if enable_uptime == true %}
|
||||||
LoadPlugin uptime
|
LoadPlugin uptime
|
||||||
|
{% endif %}
|
||||||
#LoadPlugin users
|
#LoadPlugin users
|
||||||
#LoadPlugin virt
|
#LoadPlugin virt
|
||||||
#LoadPlugin vmem
|
|
||||||
|
|
||||||
{% if enable_prometheus == true %}
|
{% if enable_apcups == true %}
|
||||||
LoadPlugin write_prometheus
|
<Plugin apcups>
|
||||||
|
Host "{{ apcups_host }}"
|
||||||
|
Port "{{ apcups_port }}"
|
||||||
|
ReportSeconds {{ apcups_report_seconds }}
|
||||||
|
PersistentConnection {{ apcups_persistent_connection }}
|
||||||
|
</Plugin>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
#<Plugin apcups>
|
{% if enable_battery == true %}
|
||||||
# Host "localhost"
|
<Plugin "battery">
|
||||||
# Port "3551"
|
ValuesPercentage {{ battery_percentage }}
|
||||||
# ReportSeconds true
|
ReportDegraded {{ battery_report_degraded }}
|
||||||
# PersistentConnection true
|
QueryStateFS false
|
||||||
#</Plugin>
|
</Plugin>
|
||||||
|
{% endif %}
|
||||||
#<Plugin "battery">
|
|
||||||
# ValuesPercentage false
|
|
||||||
# ReportDegraded false
|
|
||||||
# QueryStateFS false
|
|
||||||
#</Plugin>
|
|
||||||
|
|
||||||
#<Plugin chrony>
|
#<Plugin chrony>
|
||||||
# Host "localhost"
|
# Host "localhost"
|
||||||
|
@ -102,9 +70,13 @@ LoadPlugin write_prometheus
|
||||||
# Timeout "2"
|
# Timeout "2"
|
||||||
#</Plugin>
|
#</Plugin>
|
||||||
|
|
||||||
#<Plugin connectivity>
|
{% if enable_connectivity == true %}
|
||||||
# Interface eth0
|
<Plugin connectivity>
|
||||||
#</Plugin>
|
{% for interface in connectivity_interfaces %}
|
||||||
|
Interface {{ interface }}
|
||||||
|
{% endfor %}
|
||||||
|
</Plugin>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
#<Plugin cgroups>
|
#<Plugin cgroups>
|
||||||
# CGroup "libvirt"
|
# CGroup "libvirt"
|
||||||
|
@ -113,16 +85,10 @@ LoadPlugin write_prometheus
|
||||||
|
|
||||||
{% if enable_cpu == true %}
|
{% if enable_cpu == true %}
|
||||||
<Plugin cpu>
|
<Plugin cpu>
|
||||||
{% if report_by_cpu == true %}
|
ReportByCpu {{ cpu_report_by_cpu }}
|
||||||
ReportByCpu true
|
ReportByState {{ cpu_report_by_state }}
|
||||||
{% endif %}
|
ValuesPercentage {{ cpu_values_percentage }}
|
||||||
{% if report_by_state == true %}
|
ReportNumCpu {{ cpu_report_num_cpus }}
|
||||||
ReportByState true
|
|
||||||
{% endif %}
|
|
||||||
ValuesPercentage true
|
|
||||||
ReportNumCpu false
|
|
||||||
ReportGuestState false
|
|
||||||
SubtractGuestState true
|
|
||||||
</Plugin>
|
</Plugin>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
@ -172,10 +138,13 @@ LoadPlugin write_prometheus
|
||||||
# </Directory>
|
# </Directory>
|
||||||
#</Plugin>
|
#</Plugin>
|
||||||
|
|
||||||
#<Plugin hddtemp>
|
{% if enable_hddtemp == true %}
|
||||||
# Host "127.0.0.1"
|
<Plugin hddtemp>
|
||||||
# Port "7634"
|
Host "127.0.0.1"
|
||||||
#</Plugin>
|
Port "7634"
|
||||||
|
# TranslateDevicename true
|
||||||
|
</Plugin>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
#<Plugin hugepages>
|
#<Plugin hugepages>
|
||||||
# ReportPerNodeHP true
|
# ReportPerNodeHP true
|
||||||
|
@ -198,10 +167,11 @@ LoadPlugin write_prometheus
|
||||||
</Plugin>
|
</Plugin>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
#<Plugin md>
|
{% if enable_md == true %}
|
||||||
# Device "/dev/md0"
|
<Plugin md>
|
||||||
# IgnoreSelected false
|
Device "{{ md_device }}"
|
||||||
#</Plugin>
|
</Plugin>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if enable_memory == true %}
|
{% if enable_memory == true %}
|
||||||
<Plugin memory>
|
<Plugin memory>
|
||||||
|
@ -250,7 +220,7 @@ LoadPlugin write_prometheus
|
||||||
# IgnoreSelected false
|
# IgnoreSelected false
|
||||||
#</Plugin>
|
#</Plugin>
|
||||||
|
|
||||||
{% if enable_influx %}
|
{% if influx_host != "" %}
|
||||||
<Plugin network>
|
<Plugin network>
|
||||||
Server "{{ influx_host }}" "{{ influx_port }}"
|
Server "{{ influx_host }}" "{{ influx_port }}"
|
||||||
</Plugin>
|
</Plugin>
|
||||||
|
@ -545,11 +515,10 @@ LoadPlugin write_prometheus
|
||||||
</Plugin>
|
</Plugin>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if enable_prometheus == true %}
|
{% if prometheus_port != "" %}
|
||||||
<Plugin "write_prometheus">
|
<Plugin "write_prometheus">
|
||||||
Port "{{ prometheus_port }}"
|
Port "{{ prometheus_port }}"
|
||||||
</Plugin>
|
</Plugin>
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
#<Plugin sysevent>
|
#<Plugin sysevent>
|
||||||
|
@ -580,6 +549,8 @@ LoadPlugin write_prometheus
|
||||||
# PersistentNotification false
|
# PersistentNotification false
|
||||||
#</Plugin>
|
#</Plugin>
|
||||||
|
|
||||||
#<Plugin vmem>
|
{% if enable_vmem == true %}
|
||||||
# Verbose false
|
<Plugin vmem>
|
||||||
#</Plugin>
|
Verbose {{ vmem_verbose }}
|
||||||
|
</Plugin>
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue