🔎 PfSense to InfluxDB - Monitoring

🔎 PfSense to InfluxDB - Monitoring

Networks can become kind of cluttery, and there can be lots of interactions between interfaces

  • LAN
  • WI-FI
  • WAN
  • DMZ

This is why I want to monitor my PfSense via Grafana

Prerequisites

  • An InfluxDB server
  • A Grafana server and...
  • A PfSense firewall!

Installation of Telegraf

A while ago, I installed Telegraf by hand : did a wget on PfSense, installed, enabled and configured the Telegraf service...

I made some research, and found this post on the netgate forum:

firefox_2018-07-22_18-24-28

I gave it a shot:
firefox_2018-07-22_18-24-47

I pushed the install buttton, twice, because I missed. Then I finally click confirm (once). And
The_Greatest_Showman_TADA-1 firefox_2018-07-22_18-48-25

Create users and a database in InfluxDB

I created a database named pla01_firewall and two users, one with the read permission for Grafana requests, the other with the write permission for Telegraf to send data in the database

CREATE DATABASE "pla01_firewall";
CREATE USER "pla01_firewall_write" WITH PASSWORD 'WRITE_PASSWORD';
CREATE USER "pla01_firewall_read" WITH PASSWORD 'READ_PASSWORD';
GRANT READ ON pla01_firewall TO pla01_firewall_read
GRANT WRITE ON pla01_firewall TO pla01_firewall_write

Here's the real execution:
putty_2018-07-22_18-59-39-1
And yes, I changed the passwords.

Telegraf configuration

In the PfSense interface go to Services => Telegraf
firefox_2018-07-22_18-51-56
The Telegraf configuration is quite easy, and fields are similar to the text configuration file ones.
Here's the filled version:

firefox_2018-07-22_19-05-13

Data received by the InfluxDB:

putty_2018-07-22_19-32-20

I encountered trouble because I use a self-signed certificate authority, here's the solution I found : adding CA cert to FreeBSD

Make data prettier

Add the datasource in Grafana:
firefox_2018-07-22_19-09-08

New dashboard for Firewalls

firefox_2018-07-22_20-01-03

Use the good datasource

firefox_2018-07-22_20-01-47

Creation of a CPU graph

firefox_2018-07-22_20-01-09
firefox_2018-07-22_20-01-39
firefox_2018-07-22_20-01-58
firefox_2018-07-22_20-02-43

Net interface

Telegraf send data with the interface name :
firefox_2018-07-22_20-08-27

You could have the "translation" in Interfaces => Assignments

firefox_2018-07-22_20-07-36
firefox_2018-07-22_20-08-06

Dashboard that is use

firefox_2018-08-10_17-28-07