Internet Unix

Pfsense Gateway Latency with Telegraf

Some years ago I started using the Telegraf package on pfSense and was disappointed to find out that it didn’t report the gateway latencies. So I wrote a quick&dirty Python 2 script that would parse the output of pfSense’s dpinger and output it in a format that Telegraf could send to InfluxDB.

With the most recent update of pfSense to version 2.4.5 Python 2 is no longer included and I had to update my script to Python 3.

The updated version (as well as the older version for Python 2) can be found in this Gist. Copy that Python script into /usr/local/libexec/telegraf/. And don’t forget to add that “Additional configuration for Telegraf” snippet to the configuration of Telegraf in the pfSense GUI.

3 replies on “Pfsense Gateway Latency with Telegraf”


How to use this script with TICK stack + Grafana setup?
I tried installing dpinger and copied the script into telegraf container but not able make it work. Can you kindly give a clue? Thanks.

This depends on many variables. Do you have Python 3.x installed in the container? Can you run the script standalone? Is dpinger running and sending its output to the socket used in this script?

Leave a Reply

Your email address will not be published.