From ebd85f7ae02f4ca54fe4d344aa1b2cb9d8dd6541 Mon Sep 17 00:00:00 2001 From: Jeroen Schutrup Date: Sat, 17 Dec 2016 20:31:51 +0100 Subject: [PATCH 1/5] Add AllPortsSummary option to collectd tcpconns --- collectd/files/tcpconns.conf | 1 + collectd/map.jinja | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/collectd/files/tcpconns.conf b/collectd/files/tcpconns.conf index 3ab19ca..12ea44c 100644 --- a/collectd/files/tcpconns.conf +++ b/collectd/files/tcpconns.conf @@ -10,6 +10,7 @@ LoadPlugin tcpconns ListeningPorts {{ collectd_settings.plugins.tcpconns.listening_ports | lower }} + AllPortsSummary {{ collectd_settings.plugins.tcpconns.all_ports_summary | lower }} {%- for local_port in collectd_settings.plugins.tcpconns.local_ports %} LocalPort "{{ local_port }}" {%- endfor %} diff --git a/collectd/map.jinja b/collectd/map.jinja index 94b57ea..d120b27 100644 --- a/collectd/map.jinja +++ b/collectd/map.jinja @@ -161,7 +161,8 @@ 'tcpconns': { 'listening_ports': 'true', 'local_ports': [], - 'remote_ports': [] + 'remote_ports': [], + 'all_ports_summary': 'false' }, 'openvpn': { 'status_file': [ From 0dd4df724dcba7e146e6b7fa203981fa38fa98be Mon Sep 17 00:00:00 2001 From: Jeroen Schutrup Date: Wed, 4 Jan 2017 19:02:34 +0100 Subject: [PATCH 2/5] Make packagename for liboping configurable (FreeBSD compat) Change-Id: I075777f24578ab835a1c55c1a8e4a89d1238e00a --- collectd/map.jinja | 3 +++ collectd/ping.sls | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/collectd/map.jinja b/collectd/map.jinja index d120b27..3e4431b 100644 --- a/collectd/map.jinja +++ b/collectd/map.jinja @@ -104,6 +104,9 @@ 'ReverseLookups': 'false' }, 'ping': { + 'pkg': { + 'name': 'liboping0' + }, 'hosts': ['google.com', 'yahoo.com'], 'hosts_from_grains': {}, }, diff --git a/collectd/ping.sls b/collectd/ping.sls index 2a9c3df..8c4311a 100644 --- a/collectd/ping.sls +++ b/collectd/ping.sls @@ -4,6 +4,7 @@ include: - collectd liboping0: +{{ collectd_settings.plugins.ping.pkg.name }}: pkg.installed {{ collectd_settings.plugindirconfig }}/ping.conf: @@ -14,6 +15,6 @@ liboping0: - mode: 644 - template: jinja - require: - - pkg: liboping0 + - pkg: {{ collectd_settings.plugins.ping.pkg.name }} - watch_in: - service: collectd-service From f387567682bd8f7524a3429da6b3ebd552f26c8c Mon Sep 17 00:00:00 2001 From: Jeroen Schutrup Date: Wed, 4 Jan 2017 19:02:34 +0100 Subject: [PATCH 3/5] Make packagename for liboping configurable (FreeBSD compat) Change-Id: I075777f24578ab835a1c55c1a8e4a89d1238e00a --- collectd/ping.sls | 1 - 1 file changed, 1 deletion(-) diff --git a/collectd/ping.sls b/collectd/ping.sls index 8c4311a..b63f8c5 100644 --- a/collectd/ping.sls +++ b/collectd/ping.sls @@ -3,7 +3,6 @@ include: - collectd -liboping0: {{ collectd_settings.plugins.ping.pkg.name }}: pkg.installed From e7c30d10a47d1d2afcc1dbc8bcfbaec8d5ad1e3f Mon Sep 17 00:00:00 2001 From: Jeroen Schutrup Date: Mon, 7 Aug 2017 20:47:21 +0200 Subject: [PATCH 4/5] Add collect swap plugin --- collectd/files/swap.conf | 17 +++++++++++++++++ collectd/map.jinja | 6 ++++++ collectd/swap.sls | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 collectd/files/swap.conf create mode 100644 collectd/swap.sls diff --git a/collectd/files/swap.conf b/collectd/files/swap.conf new file mode 100644 index 0000000..3b9f473 --- /dev/null +++ b/collectd/files/swap.conf @@ -0,0 +1,17 @@ +{%- 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 swap + + + ReportBytes "{{ collectd_settings.plugins.swap.ReportBytes|lower }}" + ReportByDevice "{{ collectd_settings.plugins.swap.ReportByDevice|lower }}" + ValuesPercentage "{{ collectd_settings.plugins.swap.ValuesPercentage|lower }}" + ValuesAbsolute "{{ collectd_settings.plugins.swap.ValuesAbsolute|lower }}" + diff --git a/collectd/map.jinja b/collectd/map.jinja index d120b27..ea6ae1c 100644 --- a/collectd/map.jinja +++ b/collectd/map.jinja @@ -121,6 +121,12 @@ 'host': '"::"', 'port': 8125 }, + 'swap': { + 'ValuesAbsolute': 'true', + 'ValuesPercentage': 'false' + 'ReportByDevice': 'false' + 'ReportBytes': 'false' + }, 'syslog': { 'loglevel': 'info' }, diff --git a/collectd/swap.sls b/collectd/swap.sls new file mode 100644 index 0000000..15e65c6 --- /dev/null +++ b/collectd/swap.sls @@ -0,0 +1,14 @@ +{% from "collectd/map.jinja" import collectd_settings with context %} + +include: + - collectd + +{{ collectd_settings.plugindirconfig }}/swap.conf: + file.managed: + - source: salt://collectd/files/swap.conf + - user: {{ collectd_settings.user }} + - group: {{ collectd_settings.group }} + - mode: 644 + - template: jinja + - watch_in: + - service: collectd-service From 781f1792f95faf9faf6a8f203d117005da229de2 Mon Sep 17 00:00:00 2001 From: Jeroen Schutrup Date: Sat, 30 Sep 2017 14:09:02 +0200 Subject: [PATCH 5/5] Add support for write_http --- collectd/files/write_http.conf | 19 +++++++++++++++++++ collectd/map.jinja | 4 ++++ collectd/write_http.sls | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 collectd/files/write_http.conf create mode 100644 collectd/write_http.sls diff --git a/collectd/files/write_http.conf b/collectd/files/write_http.conf new file mode 100644 index 0000000..facc82f --- /dev/null +++ b/collectd/files/write_http.conf @@ -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 + + + + 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 %} + + diff --git a/collectd/map.jinja b/collectd/map.jinja index d14f18d..696f7c4 100644 --- a/collectd/map.jinja +++ b/collectd/map.jinja @@ -139,6 +139,10 @@ 'prefix': 'collectd', 'postfix': '' }, + 'write_http': { + 'host': salt['grains.get']('fqdn'), + 'port': 80, + }, 'write_riemann': { 'host': salt['grains.get']('fqdn'), 'port': 5555, diff --git a/collectd/write_http.sls b/collectd/write_http.sls new file mode 100644 index 0000000..32ac939 --- /dev/null +++ b/collectd/write_http.sls @@ -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