Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AllPortsSummary option to collectd tcpconns #95

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions collectd/files/swap.conf
Original file line number Diff line number Diff line change
@@ -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

<Plugin 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 }}"
</Plugin>
1 change: 1 addition & 0 deletions collectd/files/tcpconns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ LoadPlugin tcpconns

<Plugin "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 %}
Expand Down
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>
16 changes: 15 additions & 1 deletion collectd/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
'port': '11211',
},
'ping': {
'pkg': {
'name': 'liboping0'
},
'hosts': ['google.com', 'yahoo.com'],
'hosts_from_grains': {},
},
Expand All @@ -154,6 +157,12 @@
'host': '"::"',
'port': 8125
},
'swap': {
'ValuesAbsolute': 'true',
'ValuesPercentage': 'false',
'ReportByDevice': 'false',
'ReportBytes': 'false'
},
'syslog': {
'loglevel': 'info'
},
Expand All @@ -163,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 Expand Up @@ -194,7 +207,8 @@
'tcpconns': {
'listening_ports': 'true',
'local_ports': [],
'remote_ports': []
'remote_ports': [],
'all_ports_summary': 'false'
},
'unixsock': {
'socket_file': '/var/run/collectd.socket',
Expand Down
4 changes: 2 additions & 2 deletions collectd/ping.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
include:
- collectd

liboping0:
{{ collectd_settings.plugins.ping.pkg.name }}:
pkg.installed

{{ collectd_settings.plugindirconfig }}/ping.conf:
Expand All @@ -14,6 +14,6 @@ liboping0:
- mode: 644
- template: jinja
- require:
- pkg: liboping0
- pkg: {{ collectd_settings.plugins.ping.pkg.name }}
- watch_in:
- service: collectd-service
14 changes: 14 additions & 0 deletions collectd/swap.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 }}/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
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