2

On pfSense, I've enabled Prometheus Node Exporter, but it gives the following log errors each 15 seconds:

Feb 15 09:53:57 vault node_exporter[25559]: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=uname duration_seconds=1.9687e-05 err="cannot allocate memory"
Feb 15 09:53:57 vault node_exporter[25559]: ts=2024-02-15T08:53:57.164Z caller=collector.go:169 level=error msg="collector failed" name=zfs duration_seconds=1.6108e-05 err="couldn't get sysctl: no such file or directory"

This is my Node Exporter settings:

enter image description here

I'm not sure which collector gives the errors (on second thought, it seems to be some collectors that are not enabled, but still trying to collect). In any case, if I need it I might not be able to disable it, so another option would be to suppress the error messages in the log.

I've tried:

  • Setting --log.level=none, but this is apparently not a valid log level

  • Creating a 01-node-exporter.conf file to suppress the messages, like this:

    if $msg contains "collector failed" then {
        stop
    }
    

    And put it inside /var/etc/syslog.d/. But this doesn't seem to suppress the messages either (this is working for me on Ubuntu).

  • I also tried this advice, and instead put this into the 01-node-exporter.conf file, but to no avail:

    :msg, contains, "collector failed" ~
    

In addition, I've found the node_exporter config file, which is located at /usr/local/etc/rc.conf.d. This file contains:

# This file is generated by the pfSense node_exporter package.
# Do not edit this file, it will be overwritten automatically.

node_exporter_enable="YES"
node_exporter_listen_address="10.10.1.1:9100"
node_exporter_args=" --collector.boottime --collector.cpu --collector.exec --collector.filesystem --collector.loadavg --collector.meminfo --collector.netdev --collector.textfile --collector.time --log.level=error"

I'm inclined to think the erroneous log messages is a bug in Node Exporter for FreeBSD (because the collectors uname and zfs doesn't even seem to be enabled), so the short term solution would be to suppress the log messages.

1 Answer 1

1

I finally found a solution. I couldn't get any syslog configuration to work, but I managed to edit the node_exporter config file like this:

# This file is generated by the pfSense node_exporter package.
# Do not edit this file, it will be overwritten automatically.

node_exporter_enable="YES"
node_exporter_listen_address="10.10.1.1:9100"
node_exporter_args=" --collector.boottime --collector.cpu --collector.exec --collector.filesystem --collector.loadavg --collector.meminfo --collector.netdev --collector.textfile --collector.time --log.level=error --no-collector.zfs --no-collector.uname" 

Note that I added --no-collector.zfs and --no-collector.uname to the node_exporter_args. This prevents these collectors from running, and thus the error messages disappear.

I would still like to know how to directly suppress log messages in FreeBSD through the syslog configuration, but that'll be another time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .