Skip to content

Commit

Permalink
Add support for write_http
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen92 committed Oct 13, 2018
1 parent a04cc32 commit e280c0a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
19 changes: 19 additions & 0 deletions collectd/files/write_http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{%- from "collectd/map.jinja" import collectd_settings with context %}
#
# DO NOT EDIT
#
# This file is managed by salt via {{ source }}
# Modify the config that generates this file instead
#

LoadPlugin write_http

<Plugin write_http>
<Node "{{ collectd_settings.plugins.write_http.name }}" >
URL "{{ collectd_settings.plugins.write_http.url }}"
Format "{{ collectd_settings.plugins.write_http.format }}"
{%- if collectd_settings.plugins.write_http.storerates is defined and collectd_settings.plugins.write_http.storerates %}
StoreRates {{ collectd_settings.plugins.write_http.storerates|lower }}
{%- endif %}
</Node>
</Plugin>
4 changes: 4 additions & 0 deletions collectd/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
'prefix': 'collectd.',
'postfix': ''
},
'write_http': {
'host': salt['grains.get']('fqdn'),
'port': 80,
},
'write_riemann': {
'host': salt['grains.get']('fqdn'),
'port': 5555,
Expand Down
14 changes: 14 additions & 0 deletions collectd/write_http.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% from "collectd/map.jinja" import collectd_settings with context %}
include:
- collectd
{{ collectd_settings.plugindirconfig }}/write_http.conf:
file.managed:
- source: salt://collectd/files/write_http.conf
- user: {{ collectd_settings.user }}
- group: {{ collectd_settings.group }}
- mode: 644
- template: jinja
- watch_in:
- service: collectd-service

0 comments on commit e280c0a

Please sign in to comment.