Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion sysutils/node_exporter/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PLUGIN_NAME= node_exporter
PLUGIN_VERSION= 1.2
PLUGIN_VERSION= 1.3
PLUGIN_COMMENT= Prometheus exporter for machine metrics
PLUGIN_DEPENDS= node_exporter
PLUGIN_MAINTAINER= jkegh@k123.eu
Expand Down
4 changes: 4 additions & 0 deletions sysutils/node_exporter/pkg-descr
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ WWW: https://github.com/prometheus/node_exporter
Changelog
---------

1.3

* Add textfile collector directory support

1.2

* Allow setting IPv6 addresses as ListenAddress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,10 @@
<type>checkbox</type>
<help>Enable the ZFS collector.</help>
</field>
<field>
<id>general.textfile_directory</id>
<label>Textfile Directory</label>
<type>text</type>
<help>Path to a directory read by the textfile collector. Files ending in .prom in this directory will be exposed as metrics. Leave empty to disable. Example: /var/db/node_exporter</help>
</field>
</form>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/NodeExporter</mount>
<description>node_exporter configuration</description>
<version>0.2.0</version>
<version>0.3.0</version>
Comment thread
fichtner marked this conversation as resolved.
Outdated
<items>
<enabled type="BooleanField">
<Default>0</Default>
Expand Down Expand Up @@ -29,5 +29,6 @@
<interrupts type="BooleanField"/>
<ntp type="BooleanField"/>
<zfs type="BooleanField"/>
<textfile_directory type="TextField"/>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really prefer a checkbox pointing to a single location instead of allowing to inject an arbitrary directory (and commands hint-hint) into this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — updated. The TextField is now a BooleanField checkbox, and the directory is hardcoded to /var/db/node_exporter/textfile. Latest commit: 17c5ed4.

</items>
</model>
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,17 @@
{%- set zfs = no_collector + "zfs " -%}
{%- endif -%}

{%- if not helpers.empty('OPNsense.NodeExporter.textfile_directory') -%}
{%- set textfile_directory = "--collector.textfile.directory=" + OPNsense.NodeExporter.textfile_directory + " " -%}
{%- 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_args="{{ cpu }}{{ exec }}{{ filesystem }}{{ loadavg }}{{ meminfo }}{{ netdev }}{{ ntp }}{{ time }}{{ devstat }}{{ zfs }}{{ textfile_directory }}"
node_exporter_listen_address="{{ listenaddress }}:{{ OPNsense.NodeExporter.listenport }}"
node_exporter_enable="YES"

Expand Down