Skip to content

Commit

Permalink
net-mgmt/collectd: add prefix and postfix input fields (opnsense#298)
Browse files Browse the repository at this point in the history
* bump version

* add pre and postfix

* add pre and postfix

* add pre and postfix to template

* set version 1.1.0

* set version to 1.0.0
  • Loading branch information
mimugmail authored and fichtner committed Sep 29, 2017
1 parent c481894 commit 3e203bd
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net-mgmt/collectd/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PLUGIN_NAME= collectd
PLUGIN_VERSION= 1.0
PLUGIN_VERSION= 1.1
PLUGIN_COMMENT= Collect system and application performance metrics periodically
PLUGIN_DEPENDS= collectd5
PLUGIN_MAINTAINER= [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@
<type>text</type>
<help>Set the port of the graphite collector, Graphite is using 2003 per default.</help>
</field>
<field>
<id>general.p_graphite_prefix</id>
<label>Graphite Prefix</label>
<type>text</type>
<help>Prefix to set before the hostname. If it ends with a dot it creates an own directory.</help>
</field>
<field>
<id>general.p_graphite_postfix</id>
<label>Graphite Postfix</label>
<type>text</type>
<help>String to set after the hostname. For compatibility reason default is collectd, but you can also simply remove it.</help>
</field>
<field>
<id>general.p_contextswitch_enable</id>
<label>Enable contextswitch plugin</label>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<model>
<mount>//OPNsense/collectd/general</mount>
<description>Collectd configuration</description>
<version>1.0.0</version>
<items>
<enabled type="BooleanField">
<default>0</default>
Expand Down Expand Up @@ -68,6 +69,14 @@
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
</p_graphite_port>
<p_graphite_prefix type="TextField">
<default>collectd</default>
<Required>N</Required>
</p_graphite_prefix>
<p_graphite_postfix type="TextField">
<default>collectd</default>
<Required>N</Required>
</p_graphite_postfix>
<p_contextswitch_enable type="BooleanField">
<default>1</default>
<Required>N</Required>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ LoadPlugin write_graphite
Protocol "tcp"
ReconnectInterval 0
LogSendErrors true
Prefix "collectd"
Postfix "collectd"
{% if helpers.exists('OPNsense.collectd.general.p_graphite_prefix') and OPNsense.collectd.general.p_graphite_prefix != '' %}
Prefix "{{ OPNsense.collectd.general.p_graphite_prefix }}"
{% endif %}
{% if helpers.exists('OPNsense.collectd.general.p_graphite_postfix') and OPNsense.collectd.general.p_graphite_postfix != '' %}
Postfix "{{ OPNsense.collectd.general.p_graphite_postfix }}"
{% endif %}
StoreRates true
AlwaysAppendDS false
EscapeCharacter "_"
Expand Down

0 comments on commit 3e203bd

Please sign in to comment.