pfSense has a plugin for telegraf which can be installed from the gui. I recommend this method rather than what I figured out below. I’m leaving these notes for manual installation reference.
I put this guide together using information from various other blogs. This is current as of December 2017 and using pfSense 2.4.2. For this tutorial, you’ll need your IP or hostname of your influxdb data source and your username and password.
The data flow is as follows:
pfSense -> Telegraf (gather metrics) -> InfluxDB (store metrics) -> Grafana (render graphs)
ssh in to pfsense and select option 8 to get a shell
Edit the telegraf config file:
Make the following changes:
You’ll have to modify the inputs for your own setup. In this example, I’ll be monitoring an OpenVPN tunnel and 3 interfaces: WAN, LAN and backup WAN.
Finally, start telegraf:
You won’t need to restart anything on the pfSense box. If you have any issues, you can look at the log file (/var/log/telegraf.log). In a future blog post I’ll show how to create a data source in Grafana using the influx source and building a basic graph.
I’m mainly graphing bandwidth, but you can graph any of the following:
One of the hurdles I encountered when building the dashboard panels is that Telegraf is reporting counters (or accumulators), so you have to massage the data to get anything useful. The trick here is to use the DERIVATIVE function in the panel configuration. This gives you the delta for a time series so you can actually see what is being sent or received:
Another thing I found useful was to add the MATH paramenter as: “*-1” (multiply by negative one) for sent data. This inverts the sent data into the negative which makes the graph easier to view at a glance.