What you need before you start

Connecting pfSense to New Relic means sending your firewall's performance data — CPU, memory, network traffic, and system health — to New Relic's monitoring platform. New Relic then displays this data in dashboards so you can see what your pfSense box is doing in real time.

To make this connection work, you need three things: a New Relic account with an API key, the New Relic Infrastructure agent installed on your pfSense system, and SSH access to your pfSense box so you can run the installation commands. If you do not have SSH enabled on pfSense yet, you will need to turn that on first through the web interface under System > Advanced > Admin Access.

New Relic's free tier includes infrastructure monitoring, so you can start without paying. However, if your pfSense box sends more than 100 GB of data per month, New Relic will ask you to move to a paid plan. For most small networks, the free tier is enough.

Key Takeaways

  • You must have a New Relic account and an API key before you install anything on pfSense.
  • The New Relic Infrastructure agent runs on pfSense itself and sends system metrics back to New Relic's servers every 15 seconds by default.
  • Installation happens through SSH commands in the pfSense shell, not through the web interface.
  • After the agent starts, it takes about five minutes for data to appear in your New Relic dashboard.
  • If the agent does not start, check that your pfSense system has internet access and that your API key is correct in the configuration file.

Getting your New Relic API key

Log into your New Relic account at one.newrelic.com. In the top right corner, click your account name, then select API keys from the dropdown menu. On the API keys page, look for the section labeled "License key" — this is what pfSense needs to send data to New Relic.

Click the copy icon next to your license key to copy it to your clipboard. Save this key somewhere safe; you will paste it into the pfSense configuration file in a few minutes. Do not share this key with anyone, because it gives access to your New Relic account.

If you do not see a license key on this page, you may need to create one. Look for a button that says "Create key" or "Generate key" and select License Key as the type. New Relic will create a new key instantly.

Enabling SSH on pfSense and connecting

Open the pfSense web interface in your browser and log in. Go to System > Advanced, then scroll down to the Admin Access section. Check the box next to "Enable Secure Shell (SSH)" and click Save at the bottom of the page. pfSense will restart the SSH service in the background.

Now open a terminal or command prompt on your computer. On Mac or Linux, use the Terminal app. On Windows, use PowerShell or download PuTTY if you prefer a graphical tool. Type this command, replacing 192.168.1.1 with your actual pfSense IP address and admin with your pfSense username:

ssh admin@192.168.1.1

Press Enter. pfSense will ask you to confirm the connection by typing "yes" and then ask for your password. Enter your pfSense admin password. You should now see a command prompt that says "pfSense" or shows your pfSense hostname.

Installing the New Relic Infrastructure agent

Once you are connected via SSH, you need to download and run the New Relic installer. Type this command into your SSH session:

curl https://download.newrelic.com/infrastructure_agent/install/freebsd/newrelic-infra_freebsd_amd64.tar.gz -o newrelic-infra.tar.gz

This downloads the New Relic agent package for FreeBSD, which is what pfSense runs on. After the download finishes, extract the files by typing:

tar -xzf newrelic-infra.tar.gz

Then navigate into the extracted folder and run the installer:

cd newrelic-infra && sudo ./installer.sh

The installer will ask you a few questions. When it asks for your license key, paste the API key you copied from New Relic earlier. The installer will create the necessary configuration files and start the agent automatically.

Configuring the agent with your API key

If the installer did not ask for your license key or if you need to add it manually, you can edit the configuration file directly. Type this command:

sudo vi /etc/newrelic-infra.yml

This opens the configuration file in a text editor. Look for a line that says license_key: and paste your New Relic license key after it, like this:

license_key: YOUR_LICENSE_KEY_HERE

Save the file by pressing Escape, then typing :wq and pressing Enter. Now restart the New Relic agent so it picks up the new configuration:

sudo service newrelic-infra restart

The agent will start sending data to New Relic. You can check that it is running by typing:

sudo service newrelic-infra status

If you see "running" or "active", the agent is working correctly.

Viewing your pfSense data in New Relic

Go back to your New Relic account in your browser and wait about five minutes for data to arrive. Then click on Infrastructure in the left sidebar. You should see your pfSense system listed under Hosts. Click on it to open the dashboard.

The dashboard shows CPU usage, memory, disk space, network traffic in and out, and other system metrics. You can change the time range at the top right to see data from the last hour, day, or week. If you do not see your pfSense system in the list after five minutes, check that the agent is still running by going back to your SSH session and typing the status command again.

You can also create custom dashboards and alerts in New Relic. For example, you can set up an alert that sends you an email if your pfSense CPU stays above 80% for more than five minutes. These features are available in the Alerts section of the New Relic menu.

Troubleshooting when data does not appear

If your pfSense system does not show up in New Relic after ten minutes, the most common cause is that the agent cannot reach New Relic's servers. Check that your pfSense box has internet access by going back to your SSH session and typing ping 8.8.8.8. If you see responses, your internet connection is working.

The second most common issue is an incorrect license key. Go back to your SSH session and open the configuration file again with sudo vi /etc/newrelic-infra.yml. Make sure the license key is exactly as it appears in your New Relic account, with no extra spaces or characters. Save the file and restart the agent again.

If the agent will not start at all, check the agent logs by typing sudo tail -f /var/log/newrelic-infra.log. This shows you the last few lines of the agent's activity. If you see an error message, search for that error in New Relic's documentation or your firewall logs to understand what went wrong.

Frequently Asked Questions

Can I monitor multiple pfSense boxes with one New Relic account?

Yes. Each pfSense system needs its own agent installation and the same license key. After you install the agent on the second pfSense box, it will appear as a separate host in your New Relic Infrastructure dashboard. You can then create dashboards that show metrics from all your pfSense systems at once.

What happens if I restart pfSense after installing the agent?

The New Relic agent is set to start automatically when pfSense boots up, so you do not need to reinstall it. After a restart, wait about two minutes for the agent to start and then check New Relic to confirm data is flowing again.

Does the New Relic agent slow down my pfSense box?

The agent uses very little CPU and memory — typically less than 1% of your system resources. It sends data every 15 seconds by default, which uses minimal bandwidth. On most networks, you will not notice any performance impact.

Can I change how often the agent sends data to New Relic?

Yes. Open the configuration file with sudo vi /etc/newrelic-infra.yml and look for a line that says metric_interval:. The default is 15 seconds. You can change this to 30 seconds or 60 seconds to reduce data usage, then restart the agent with sudo service newrelic-infra restart.

What if I want to stop sending data to New Relic?

Type sudo service newrelic-infra stop to stop the agent. To remove it completely, type sudo pkg delete newrelic-infra. Your historical data will remain in New Relic for 13 months, but no new data will be collected after you stop the agent.