Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Telegraf on PFsense Error

    Scheduled Pinned Locked Moved pfSense Packages
    13 Posts 2 Posters 130 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pst @gm2005fl
      last edited by

      @gm2005fl there is also this option, which might bypass the need to configure a CA altogether

      9ffa8c64-6759-4966-8d13-e649b37193e4-image.png

      Try enabling that and see if that helps.

      G 1 Reply Last reply Reply Quote 0
      • G
        gm2005fl @pst
        last edited by

        @pst I did the skip and it did not help.

        1 Reply Last reply Reply Quote 0
        • G
          gm2005fl @pst
          last edited by

          @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

          P 1 Reply Last reply Reply Quote 0
          • P
            pst @gm2005fl
            last edited by

            @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.

            G 1 Reply Last reply Reply Quote 0
            • G
              gm2005fl @pst
              last edited by

              @pst Cool thank you I will get it updated and see how I do. Fingers crossed.

              G 1 Reply Last reply Reply Quote 1
              • G
                gm2005fl @gm2005fl
                last edited by

                @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.

                P 1 Reply Last reply Reply Quote 0
                • P
                  pst @gm2005fl
                  last edited by

                  @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 :)

                  G 1 Reply Last reply Reply Quote 0
                  • G
                    gm2005fl @pst
                    last edited by

                    @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.

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      pst @gm2005fl
                      last edited by

                      @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.

                      G 1 Reply Last reply Reply Quote 0
                      • G
                        gm2005fl @pst
                        last edited by

                        @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 :)

                        P 1 Reply Last reply Reply Quote 1
                        • P
                          pst @gm2005fl
                          last edited by

                          @gm2005fl that's great news, and very useful information for those of us (i.e me!) not realising there are different versions InfluxDB :)

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.