Skip to content

Instantly share code, notes, and snippets.

@ccwoolf
Last active May 29, 2024 17:03
Show Gist options
  • Save ccwoolf/739798f507be202723ecd59a0ef83b34 to your computer and use it in GitHub Desktop.
Save ccwoolf/739798f507be202723ecd59a0ef83b34 to your computer and use it in GitHub Desktop.
Install node_exporter on PFSense and start on boot

Install Prometheus node_exporter on PFSense and start on boot

Install node_exporter

Check FreeBSD Ports for the latest version.

Log in via SSH or otherwise somehow execute the following command:

pkg install http://pkg.freebsd.org/FreeBSD:11:amd64/latest/All/node_exporter-0.18.1.txz

Starting on boot

Adding service node_exporter start as a Shellcmd will prevent your PFSense install from booting successfully. To resolve this, see troubleshooting.

Your best option which doesn't require editing any files is to install the Bash and Shellcmd packages, then add bash -c "nohup node_exporter >/dev/null 2>&1 &" as a Shellcmd in Services --> Shellcmd.

  • Bash must be installed using pkg install bash from a shell. There is no way to install it by itself from PFSense's package manager.
  • Shellcmd can be installed using PFSense's package manager.

Troubleshooting

If you found yourself with an unbootable PFSense install (after, for example, adding service node_exporter start as a shellcmd):

  1. Boot into single user mode,
  2. Remount your filesystem read-write (or if using ZFS, run zfs set readonly=off zroot/ROOT/default),
  3. Remove the shellcmd line mentioning node_exporter from /cf/conf/config.xml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment