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

    Grafana Dashboard using Telegraf with additional plugins

    Scheduled Pinned Locked Moved pfSense Packages
    173 Posts 28 Posters 78.7k 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.
    • V
      VictorRobellini @cburbs
      last edited by VictorRobellini

      @cburbs

      It would be too much of a PITA to update both. Plus GitHub is a much better place to host the project since there are multiple readmes, additional files, bugs, and merge/pull options. Formatting things in the right way isn't possible on Grafana's site.

      Which is why the very first line of my Grafana post reads:

      For the latest version, visit: https://github.com/VictorRobellini/pfSense-Dashboard

      C 1 Reply Last reply Reply Quote 0
      • C
        cburbs @VictorRobellini
        last edited by

        @VictorRobellini Totally understand and thanks for the heads up.

        1 Reply Last reply Reply Quote 1
        • _
          _rp @bigjohns97
          last edited by

          @bigjohns97 said in Grafana Dashboard using Telegraf with additional plugins:

          Any idea why I would be getting the following when trying the telegraf_gateways.py option?

          [inputs.exec] Error in plugin: exec: fork/exec /usr/local/bin/telegraf_gateways.py: no such file or directory for command '/usr/local/bin/telegraf_gateways.py'

          I'm having the same issues, what did you do to fix this?

          I am using the fastjack version from here https://gist.github.com/fastjack/a0feb792a9655da7aa3e2a7a1d9f812f

          J 1 Reply Last reply Reply Quote 1
          • C
            Crimson11
            last edited by

            Thank you very much for your work.

            I had to install Grafana & Influxdb on Windows 2019. :|

            Everything is working fine except Active users / Uptime / Interface Summary. It says no data.

            I downloaded the files directly on Pfsense.

            The data is being populated on Influxdb, though I could not make the telegraf.log to work.

            Any idea on what am I missing?

            Thank you.

            1 Reply Last reply Reply Quote 0
            • V
              VictorRobellini
              last edited by

              If you are seeing the "Active users / Uptime / Interface Summary" in the influx DB but not on the graph, it's possible that there's an issue with the query and I don't think the telegraf.log is going to help. It could be a result of a bad dashboard import or a newer versions of Grafana.

              You will want to specifically see what gets returned by the below queries:

              select * from system limit 5
              select * from net limit 5
              
              C 1 Reply Last reply Reply Quote 0
              • C
                Crimson11 @VictorRobellini
                last edited by

                @VictorRobellini Thank you very much for the fast reply. I agree that it could be relative to a bad dashboard import.

                For the uptime panel I was able to import it from another dashboard and compared to yours and it was the same but the imported one was working.

                I was able to fix interface summary by importing directly from the Grafana website and copy/paste the panel.

                Active users was not working either on the other dashboard I imported.

                These gives data but I did not had time to format it.
                select * from system limit 5
                select * from net limit 5

                Thank you again.

                1 Reply Last reply Reply Quote 0
                • J
                  JohnKap @_rp
                  last edited by

                  @romprod said in Grafana Dashboard using Telegraf with additional plugins:

                  @bigjohns97 said in Grafana Dashboard using Telegraf with additional plugins:

                  Any idea why I would be getting the following when trying the telegraf_gateways.py option?

                  [inputs.exec] Error in plugin: exec: fork/exec /usr/local/bin/telegraf_gateways.py: no such file or directory for command '/usr/local/bin/telegraf_gateways.py'

                  I'm having the same issues, what did you do to fix this?

                  I am using the fastjack version from here https://gist.github.com/fastjack/a0feb792a9655da7aa3e2a7a1d9f812f

                  after copying the file to this folder, did you chmod +x it?

                  5b6c9a5c-1d70-473b-947d-8f108e179950-image.png

                  1 Reply Last reply Reply Quote 0
                  • P
                    pfsense99
                    last edited by pfsense99

                    For the unbound - on telegrah - looks like does not work with the latest version of pfsense and telegrah

                    It used to work..

                    In telegraf config..

                    [[inputs.unbound]]
                    server = "127.0.0.1:953"
                    binary = "/usr/local/bin/telegraf_unbound.sh"

                    Command to check:

                    /usr/local/bin/telegraf -config=/usr/local/etc/telegraf.conf --test --input-filter unbound

                    Output:
                    2020-11-18T00:31:41Z I! Starting Telegraf 1.13.4
                    2020-11-18T00:31:45Z E! [inputs.unbound] Error in plugin: error gathering metrics: error running unbound-control: Command timed out. (/usr/local/bin/telegraf_unbound.sh [-s 127.0.0.1@953 stats_noreset])
                    2020-11-18T00:31:45Z E! [telegraf] Error running agent: One or more input plugins had an error

                    1 Reply Last reply Reply Quote 0
                    • B
                      bigjohns97
                      last edited by bigjohns97

                      Recently tried out the new version of PfBlockerNG 3.0.0_1 and was looking to test the new python integration with unbound that produces the client ip in the logs when using null blocking. (requires pfsense 2.5.x and latest version of unbound)

                      Wanted to confirm that not only does it work but everything still shows up in this grafana dashboard.

                      1 Reply Last reply Reply Quote 3
                      • I
                        iso667 @erbalo
                        last edited by

                        @erbalo I am facing this similar issue, when I see the telegraf log I have this message everywhere... Did you find any solution?

                        For example:

                        d5c7e38b-77be-4283-ac33-88a4e4756509-image.png

                        1 Reply Last reply Reply Quote 0
                        • J
                          Josef
                          last edited by

                          This dashboard is absolutely fantastic! it works very well.
                          It looks like it would have taken a lot of hard work, time and effort.
                          Thanks for doing this!

                          1 Reply Last reply Reply Quote 2
                          • S
                            Szymon
                            last edited by Szymon

                            Any idea how to install Telegraf on SG-3100? pFsense version 2.4.5-RELEASE-p1 (arm).

                            1 Reply Last reply Reply Quote 0
                            • A
                              AB5G
                              last edited by

                              @VictorRobellini @erbalo

                              To calculate the monthly WAN download/upload, use the following query format

                              SELECT non_negative_difference(last("bytes_recv")) FROM "net" WHERE ("host" =~ /^$Host$/ AND "interface" =~ /^$WAN$/) AND $timeFilter GROUP BY time($__interval) fill(null)

                              Set Query Options / Relative Time to - 'now/M'. Leave Everything else as is in Query Options.

                              For Visualization use 'Stat'. Then under 'Display' select Calculations > Total

                              Then Goto Field from the TAB above / Units > bytes(SI)

                              E V 2 Replies Last reply Reply Quote 0
                              • E
                                erbalo @AB5G
                                last edited by

                                @ab5g said in Grafana Dashboard using Telegraf with additional plugins:

                                @VictorRobellini @erbalo

                                To calculate the monthly WAN download/upload, use the following query format

                                SELECT non_negative_difference(last("bytes_recv")) FROM "net" WHERE ("host" =~ /^$Host$/ AND "interface" =~ /^$WAN$/) AND $timeFilter GROUP BY time($__interval) fill(null)

                                Set Query Options / Relative Time to - 'now/M'. Leave Everything else as is in Query Options.

                                For Visualization use 'Stat'. Then under 'Display' select Calculations > Total

                                Then Goto Field from the TAB above / Units > bytes(SI)

                                Bamm! thank you, this works now for me!!! Can someone maybe upload a fully working dashboard so we can use import in grafana? With a corected Mb/s etc..

                                A 1 Reply Last reply Reply Quote 1
                                • A
                                  AB5G @erbalo
                                  last edited by

                                  @erbalo

                                  Getting Mbps on the graph is easy.

                                  Select the WAN Panel > Edit > Panel Settings > Axis / Left Y - Change this to bits/sec
                                  Also change the query to add *8

                                  So your query will look like this

                                  SELECT derivative(mean("bytes_recv"), 1s) *8 FROM "net" WHERE ("host" =~ /^$Host$/ AND "interface" =~ /^$WAN$/) AND $timeFilter GROUP BY time($__interval) fill(null)

                                  Do the same for the LAN Panel (the first one). Then click 'LAN Interfaces' (the master container for all LAN panels - see pic) . Click Settings > Repeat for Datasouce and this Mbps setting applies to all LAN panels.

                                  Screenshot 2021-01-05 at 3.14.08 PM.png

                                  E 1 Reply Last reply Reply Quote 0
                                  • E
                                    erbalo @AB5G
                                    last edited by

                                    @ab5g said in Grafana Dashboard using Telegraf with additional plugins:

                                    @erbalo

                                    Getting Mbps on the graph is easy.

                                    Select the WAN Panel > Edit > Panel Settings > Axis / Left Y - Change this to bits/sec
                                    Also change the query to add *8

                                    So your query will look like this

                                    SELECT derivative(mean("bytes_recv"), 1s) *8 FROM "net" WHERE ("host" =~ /^$Host$/ AND "interface" =~ /^$WAN$/) AND $timeFilter GROUP BY time($__interval) fill(null)

                                    Do the same for the LAN Panel (the first one). Then click 'LAN Interfaces' (the master container for all LAN panels - see pic) . Click Settings > Repeat for Datasouce and this Mbps setting applies to all LAN panels.

                                    Screenshot 2021-01-05 at 3.14.08 PM.png

                                    Thank you, for th WAN it is now correct just i am seeing there Mb/s - Megabit per second.
                                    But for the LAN i need to see MB/s = Megabyte per second. I mean i need to see the exact value such as when you copy a file from your NAS, you see there the rate MB/s.

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      masterhead
                                      last edited by masterhead

                                      This post is deleted!
                                      1 Reply Last reply Reply Quote 0
                                      • B
                                        bigjohns97
                                        last edited by

                                        I noticed recently that the systems row is no longer tracking the time range that is selected up at the top right.

                                        Is this something that should be defined in the query or did something break with an upgrade somewhere along the way?

                                        Can someone else confirm if they are able to see changes in the systems row statistics whenever the change the time frame in the upper right hand corner of the dashboard?

                                        I did go ahead and pull down the latest json from github just to be sure that wasn't the problem.

                                        A 1 Reply Last reply Reply Quote 0
                                        • A
                                          AB5G @bigjohns97
                                          last edited by

                                          @bigjohns97 Seems to be working for me.

                                          B 1 Reply Last reply Reply Quote 1
                                          • B
                                            bigjohns97 @AB5G
                                            last edited by

                                            @ab5g I did recently upgrade pretty much everything (pfsense 12, pfblockerng 3.007 grafana. Etc)

                                            Just a heads up. I haven't had a chance to dig into the data to see if the dates aren't being kept or what really has changed.

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