Telegraf on PFsense Error
-
@gm2005fl there is also this option, which might bypass the need to configure a CA altogether
Try enabling that and see if that helps.
-
@pst I did the skip and it did not help.
-
@pst I don't not have the Root-Ca configured, I can do that. I also don't have the Telegraf.ca file. When I ran the cat on it, it didn't show me the line 35. But when I did the skip SSL, it added that as line 35, but I am still getting error. BTW thank you for the help
-
@gm2005fl said in Telegraf on PFsense Error:
I also don't have the Telegraf.ca file.
I checked the code again, and that file is only created if you have the CA configured, as it takes info from that CA config.
Once you have created the CA it should all work (as it did for me).
Note, there is currently a bug in Telegraf which prevents automatic restart of the Telegraf service after changing the configuration. A small fix can be found here: https://redmine.pfsense.org/issues/16225. If you don't apply the fix you will have to manually restart Telegraf (from Status / Services) every time you update the Telegraf configuration.
-
@pst Cool thank you I will get it updated and see how I do. Fingers crossed.
-
@gm2005fl Well it looks like the data is now transferring...THANK for the help on it. I got the CA done. Now I have to figure out the issue with the 401 unauthorized between the PFsense and Influxdb.
-
@gm2005fl Great! Just double check your IP/port, database name, the username has to be the one with "write" authority (I think there was a "read" user also, that Grafana uses (if you use Grafana that is)), and obv the password :)
-
@pst Yeah I have double checked all of that, the IP/port, user, dbname etc. They all are correct. Copilot is telling me it has something to do with the API key, but not sure about that.
-
@gm2005fl I can't recall using an API key, but your end system might be completely different for all I know :)
My browsing history suggests I used this as base for my installation: https://homelabing.fr/pfblockerng-and-monitoring-pfsense-with-telegraf-influxdb-and-grafana/
It's not the easiest of reads but might give you a clue to what could be wrong, hopefully.
-
@pst Finally.... Got it. I used copilot to walk me through all of my errors. The end result,
Boom—there’s the final piece of the puzzle. Telegraf is trying to write to the InfluxDB 2.x instance using the InfluxDB 1.x-style output plugin ([[outputs.influxdb]]), which expects a database name like "pfsense". But InfluxDB 2.x doesn’t use databases—it uses buckets, orgs, and tokens. That’s why you’re getting:
401 Unauthorized and database creation failed
So long story sort, the package from Pfsense still shows the database info, I pasted the following in the "Additional Config" section and removed the database info and boom...got data
[[outputs.influxdb_v2]]
urls = ["http://192.168.1.100:8086"]
token = "your-super-secret-token"
organization = "name"
bucket = "pfsense"Holy Heck that was a lot. :) but thanks for stick with me I appreciate the support :)
-
@gm2005fl that's great news, and very useful information for those of us (i.e me!) not realising there are different versions InfluxDB :)