net-mgmt/collectd: make Hostname optional (#889)

This commit is contained in:
Michael 2018-10-04 10:01:13 +02:00 committed by Franco Fichtner
parent bf564a8475
commit 30e5d21817
3 changed files with 5 additions and 3 deletions

View file

@ -1,5 +1,5 @@
PLUGIN_NAME= collectd
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_COMMENT= Collect system and application performance metrics periodically
PLUGIN_DEPENDS= collectd5
PLUGIN_MAINTAINER= m.muenz@gmail.com

View file

@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/collectd/general</mount>
<description>Collectd configuration</description>
<version>1.0.0</version>
<version>1.0.1</version>
<items>
<enabled type="BooleanField">
<default>0</default>
@ -9,7 +9,7 @@
</enabled>
<hostname type="TextField">
<default></default>
<Required>Y</Required>
<Required>N</Required>
<mask>/^.{1,64}$/u</mask>
</hostname>
<fqdnlookup type="BooleanField">

View file

@ -2,6 +2,8 @@
{% if helpers.exists('OPNsense.collectd.general.hostname') and OPNsense.collectd.general.hostname != '' %}
Hostname "{{ OPNsense.collectd.general.hostname }}"
{% else %}
Hostname "{{ system.hostname }}"
{% endif %}
{% if helpers.exists('OPNsense.collectd.general.fqdnlookup') and OPNsense.collectd.general.fqdnlookup == '1' %}
FQDNLookup true