• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
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 70.8k 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.
  • W
    wrightsonm @wrightsonm
    last edited by Apr 28, 2021, 9:12 PM

    @VictorRobellini I've pulled down the latest version of the conf, plugins and dashboard and I have noticed 1 thing that has stopped working.

    This is the old gateway RTT dashboard. Also note the Gateway list:
    702c58c8-4a08-45f1-8c6c-ca31775a4a06-image.png

    This is the new dashboard. The gateway names have changed and RTT chart is no longer working. Does it work for you?
    5f91b997-a192-4fd8-a5f3-a4bf9f35df9f-image.png

    When running telegraf --test I think this is the relevant snippet after changing the dashboard and plugins to the new version:

    > gateways,host=fw,interface=igb0 defaultgw=1,delay=2.117,gwdescr="Interface WAN_DHCP Gateway",loss=0,monitor="192.168.0.1",source="192.168.0.30",status="online",stddev=3.885,substatus="none" 1619643426000000000
    > gateways,host=fw,interface=igb0 defaultgw=0,delay=0,gwdescr="Interface WAN_DHCP6 Gateway",loss=0,monitor="",source="",status="",stddev=0,substatus="" 1619643426000000000
    > gateways,host=fw,interface=igb0 defaultgw=1,delay=2.117,gwdescr="Interface WAN_DHCP Gateway",loss=0,monitor="192.168.0.1",source="192.168.0.30",status="online",stddev=3.885,substatus="none" 1619643426000000000
    > gateways,host=fw,interface=igb0 defaultgw=0,delay=0,gwdescr="Interface WAN_DHCP6 Gateway",loss=0,monitor="",source="",status="",stddev=0,substatus="N/A" 1619643426000000000
    
    V 1 Reply Last reply Apr 29, 2021, 2:51 AM Reply Quote 0
    • V
      VictorRobellini @wrightsonm
      last edited by Apr 29, 2021, 2:51 AM

      @wrightsonm
      Did you drop your gateways measurement? I eliminated unused tags in the influx data. I added a blurb in the Readme about things not rendering properly.

      1 Reply Last reply Reply Quote 0
      • J
        jpetovello
        last edited by Apr 30, 2021, 3:42 PM

        Great looking dashboard!

        Wondering if there are step by step instructions on how to go about installing and configuring, as I'm finding the github instructions rather lacking.

        V 1 Reply Last reply Apr 30, 2021, 10:03 PM Reply Quote 0
        • W
          wrightsonm
          last edited by Apr 30, 2021, 6:30 PM

          Ok so steps i've performed so far. I think there are bugs in the latest git repository.

          docker exec -it influxdb /bin/sh
          
          influx delete --bucket pfsense --start '1970-01-01T00:00:00Z' --stop $(date +"%Y-%m-%dT%H:%M:%SZ")  --predicate '_measurement="tail_dnsbl_log"'
          
          influx delete --bucket pfsense --start '1970-01-01T00:00:00Z' --stop $(date +"%Y-%m-%dT%H:%M:%SZ")  --predicate '_measurement="tail_ip_block_log"'
          
          influx delete --bucket pfsense --start '1970-01-01T00:00:00Z' --stop $(date +"%Y-%m-%dT%H:%M:%SZ")  --predicate '_measurement="gateways"' --org-id [id]
          
          influx delete --bucket pfsense --start '1970-01-01T00:00:00Z' --stop $(date +"%Y-%m-%dT%H:%M:%SZ")  --predicate '_measurement="interface"' --org-id [id]
          

          If your WAN config looks like mine with ipv4 and ipv6 enabled, then you end up with a problem with the gateways telegraf lines as igb0 exists twice. Gateways used to use gateway_name probably for this reason. It means that the tag grouping won't work if you have ivp4 and ipv6 enabled.

          So i've had to change telegraph_gateways.php to include gateway_name and then adjust the grafana dashboard to use gateway_name instead of interface. (basically reverting it back to how it worked on the previous revision.

          Next issue is telegraf is nolonger exporting the interface measurement.

          Looks like this changeset replaced "interface" with "gateways". Looks like a copy paste issue to me.
          github diff

          As a result of this problem, none of the interfaces show up correctly on the dashboards.
          The interface summaries work with the old version of telegraf_pfinterface.php

          Final note, is this dashboard now requires a 1440p monitor to view everything without horizontal scrolling. Would be nice if it would display on 1080p monitors

          W V 2 Replies Last reply Apr 30, 2021, 6:37 PM Reply Quote 0
          • W
            wrightsonm @wrightsonm
            last edited by wrightsonm Jul 8, 2023, 12:05 PM Apr 30, 2021, 6:37 PM

            @wrightsonm
            This is the dashboard working once again for me:

            30209c7e-4ed6-405a-8d7f-f3db254d2e0c-image.png

            telegraf --test --config /usr/local/etc/telegraf.conf

            Grafana Gateway Variable changed back to:

            SHOW TAG VALUES FROM "gateways" WITH KEY = "gateway_name" WHERE "host" =~ /^$Host$/
            

            Modified plugins:
            telegraf_gateways.php.txt

            Reverted plugin:
            telegraf_pfinterface.php.txt

            Modified dashboard:
            grafana.json.txt

            1 Reply Last reply Reply Quote 0
            • V
              VictorRobellini
              last edited by Apr 30, 2021, 9:56 PM

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

              with ipv4 and ipv6 enabled, then you end up with a problem with the gateways telegraf lines as igb0 exists twice

              Does this happen for the interface table? If you are willing to troubleshoot this with me, please open a github issue so we don't flood this thread with troubleshooting.

              W 1 Reply Last reply May 1, 2021, 9:12 AM Reply Quote 0
              • V
                VictorRobellini @jpetovello
                last edited by Apr 30, 2021, 10:03 PM

                @jpetovello This is a pet project I built for use with my homelab and documented to help others. The main prereqs are that you have influx and grafana already set up. I didn't document that since everyone is going to have their systems set up differently. Luckily, there's no shortage of tutorials available online. My recommendation is to get your influxdb and grafana setup, read the github readme, read through this thread, and search the closed issues in the github project.

                1 Reply Last reply Reply Quote 0
                • W
                  wrightsonm @VictorRobellini
                  last edited by May 1, 2021, 9:12 AM

                  @victorrobellini yeah sure. I've not got any time until Tuesday now. The solution is in the attachments and pictures above. I can raise a Pull Request with the fixes on Tuesday if you like?

                  V 1 Reply Last reply May 1, 2021, 4:43 PM Reply Quote 0
                  • V
                    VictorRobellini @wrightsonm
                    last edited by VictorRobellini May 1, 2021, 5:31 PM May 1, 2021, 4:43 PM

                    @wrightsonm I just reread what you wrote. I have no idea how that happened. Thanks for the heads up. I may just merge the 2 scripts since they are doing very similar stuff. I'll take a look this weekend.

                    Update: I merged the scripts and updated the repo. Everything should be working now.

                    1 Reply Last reply Reply Quote 0
                    • V
                      VictorRobellini @wrightsonm
                      last edited by May 1, 2021, 5:42 PM

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

                      Final note, is this dashboard now requires a 1440p monitor to view everything without horizontal scrolling.

                      Sorry, I run this on either a 4k or an ultrawide 1080p display. If you have it reformatted for 1080p just add the json with a new name and submit a PR.

                      1 Reply Last reply Reply Quote 0
                      • V
                        von Papst
                        last edited by May 2, 2021, 4:59 AM

                        I copied the new scripts for plugin and configured permissions on them (755), imported new dashboard but now I'm not getting any temperatures reading, IP or DNSBL lists, no network interface summary, no Gateway RTT or loss. Any hint what I missed in the upgrade process?

                        V 1 Reply Last reply May 2, 2021, 7:07 AM Reply Quote 0
                        • V
                          von Papst @von Papst
                          last edited by May 2, 2021, 7:07 AM

                          @von-papst Got temperatures working (CRLF from M$ messed up script). Still missing lists from pfblocker-ng and interface summary.

                          W 1 Reply Last reply May 2, 2021, 7:24 AM Reply Quote 0
                          • W
                            wrightsonm @von Papst
                            last edited by May 2, 2021, 7:24 AM

                            @von-papst check the CRLF on all the plugins. Then use the telegraf test command to check that there are no errors. Failing that add the debug logging option to telegraf and check the log file. Instructions for the above are on the GitHub readme.

                            V 2 Replies Last reply May 2, 2021, 8:19 AM Reply Quote 1
                            • V
                              von Papst @wrightsonm
                              last edited by May 2, 2021, 8:19 AM

                              @wrightsonm Got pfblocker working, changed queries and added some info. But Gateway RTT and loss still not working.
                              d20b125c-5fea-40f2-95f8-38287ff646dd-image.png

                              1 Reply Last reply Reply Quote 0
                              • V
                                von Papst @wrightsonm
                                last edited by May 2, 2021, 12:51 PM

                                @wrightsonm Got everything working now. I needed to modify some queries in the dashboard and added gateways.py script.

                                V 1 Reply Last reply May 2, 2021, 6:09 PM Reply Quote 0
                                • J
                                  jpetovello
                                  last edited by May 2, 2021, 4:02 PM

                                  I'm a bit confused, where do the plugins need to be placed? Am I supposed to upload them to my pfSense install?

                                  V 1 Reply Last reply May 2, 2021, 5:36 PM Reply Quote 0
                                  • V
                                    von Papst @jpetovello
                                    last edited by May 2, 2021, 5:36 PM

                                    @jpetovello you should upload them to you pfsense.

                                    1 Reply Last reply Reply Quote 0
                                    • V
                                      VictorRobellini @von Papst
                                      last edited by May 2, 2021, 6:09 PM

                                      @von-papst @wrightsonm

                                      I think there was some drift between my local system and my repo. I've updated the dashboard JSON. It should work with the updated gateways/interface plugin.

                                      W 1 Reply Last reply May 14, 2021, 1:11 PM Reply Quote 0
                                      • W
                                        wrightsonm @VictorRobellini
                                        last edited by May 14, 2021, 1:11 PM

                                        @victorrobellini What is your influxdb ram utilisation looking like with the latest set of changes? With the grafana dashboard, my influxdb ram has increased to 12GB. I had to increase the RAM allocation on my docker VM (now at 20GB). I'm going to keep an eye on it.

                                        I think high series cardinality might be related. Will do some investigations. Unfortunately InfluxDB OSS v2 doesn't currently implement the cardinality command (only Cloud version at the moment).
                                        https://docs.influxdata.com/influxdb/v2.0/reference/flux/stdlib/influxdb/cardinality/

                                        I also think the logged data shows something port scanning me yesterday which may be related to the big increase in cardinality of the data.

                                        V 1 Reply Last reply Jun 18, 2021, 4:36 PM Reply Quote 0
                                        • B
                                          bigjohns97
                                          last edited by Jun 10, 2021, 2:40 PM

                                          I found this neat little command playing around with PowerD options and it seems to be really light and work well for tracking CPU frequency changes.

                                          sysctl dev.cpu.0.freq

                                          Was thinking it would make a nice graph for those are also using PowerD which I would think would be most people but I could be wrong.

                                          I would write this myself but it would just end up getting done better by others in this thread :)

                                          @VictorRobellini what do you think about this, good add?

                                          V 1 Reply Last reply Jun 10, 2021, 5:22 PM Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received