Skip to content

Instantly share code, notes, and snippets.

@paxswill
Last active September 10, 2021 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paxswill/b0c1a8cabc5dae888277c4fc571da0d4 to your computer and use it in GitHub Desktop.
Save paxswill/b0c1a8cabc5dae888277c4fc571da0d4 to your computer and use it in GitHub Desktop.
Setting up Prometheus node_exporter on TrueNAS Core

Just a quick note as I need to do this every time there's a TrueNAS update.

  1. Enable the FreeBSD pkg repo (as root)

    sed -i '' -e 's/enabled: no/enabled: yes/' /usr/local/etc/pkg/repos/FreeBSD.conf
  2. Disable the local package repo:

    sed -i '' -e 's/enabled: yes/enabled: no/' /usr/local/etc/pkg/repos/local.conf
  3. Install node_exporter:

    pkg install node_exporter
  4. Ensure the rc.conf variabels are set in the TrueNAS System -> Tunables. These shouldn't be reset on upgrades, just check to make sure they're present. node_exporter_enable needs to be "YES", and I set node_exporter_args and node_exporter_listen_address as well.

  5. Start the service:

    service node_exporter start

As I mentioned above, you'll need to do this every time there's a TrueNAS update, as the system files are reset to exactly what TrueNAS expects in that case. If I could run this in a jail, I would, but it needs access to the whole ZFS pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment