sysutils/node_exporter: Allow setting IPv6 address as Listen Address (#3707)

* Node Exporter: Allow setting IPv6 listenaddress

* Node Exporter: Change IntegerField to PortField

* Node Exporter: Increment version and add changelog
This commit is contained in:
Jonatan
2024-01-08 16:07:42 +01:00
committed by GitHub
parent ff1ffbdf32
commit 89c9255d38
4 changed files with 17 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
PLUGIN_NAME= node_exporter
PLUGIN_VERSION= 1.1
PLUGIN_VERSION= 1.2
PLUGIN_COMMENT= Prometheus exporter for machine metrics
PLUGIN_DEPENDS= node_exporter
PLUGIN_MAINTAINER= jkegh@k123.eu

View File

@@ -7,6 +7,10 @@ WWW: https://github.com/prometheus/node_exporter
Changelog
---------
1.2
* Allow setting IPv6 addresses as ListenAddress
1.1
* Allow to toggle the "zfs" collector

View File

@@ -3,23 +3,21 @@
<description>
node_exporter - Prometheus exporter for hardware and OS metrics.
</description>
<version>0.1.0</version>
<version>0.2.0</version>
<items>
<enabled type="BooleanField">
<default>0</default>
<Required>Y</Required>
</enabled>
<listenaddress type="TextField">
<listenaddress type="NetworkField">
<default>0.0.0.0</default>
<Required>Y</Required>
<mask>/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-4]|2[0-5][0-9]|[01]?[0-9][0-9]?)$/</mask>
<ValidationMessage>Please provide a valid IPv4 address.</ValidationMessage>
<NetMaskAllowed>N</NetMaskAllowed>
<ValidationMessage>Please provide a valid IP address.</ValidationMessage>
</listenaddress>
<listenport type="IntegerField">
<listenport type="PortField">
<default>9100</default>
<Required>Y</Required>
<MinimumValue>1</MinimumValue>
<MaximumValue>65535</MaximumValue>
<ValidationMessage>Please provide a valid port number between 1 and 65535. Port 9100 is the default.</ValidationMessage>
</listenport>
<cpu type="BooleanField">

View File

@@ -46,8 +46,14 @@
{%- set zfs = no_collector + "zfs " -%}
{%- endif -%}
{%- if ':' in OPNsense.NodeExporter.listenaddress -%}
{%- set listenaddress = '[' + OPNsense.NodeExporter.listenaddress + ']' -%}
{%- else -%}
{%- set listenaddress = OPNsense.NodeExporter.listenaddress -%}
{%- endif -%}
node_exporter_args="{{ cpu }}{{ exec }}{{ filesystem }}{{ loadavg }}{{ meminfo }}{{ netdev }}{{ ntp }}{{ time }}{{ devstat }}{{ zfs }}"
node_exporter_listen_address="{{ OPNsense.NodeExporter.listenaddress }}:{{ OPNsense.NodeExporter.listenport }}"
node_exporter_listen_address="{{ listenaddress }}:{{ OPNsense.NodeExporter.listenport }}"
node_exporter_enable="YES"
{%- else -%}