TIG implementation over multiple raspberry Pi's to moniter NFS

unfortunately i am extremely new to this so i apologies in advance. trying to set up a couple raspberry Pi’s with a NFS and a client.
Pi #1 has the server and i have just installed Telegraph and have the basic configurations.
Pi #2 has Filzilla installed and i will install telegraf here too (trying to get the first one set it) so that both PI #1 and #2 can send the data to influxdb on Pi#3
Pi #3 has influxdb installed (user, password, org and bucket all made) and grafana is installed and will be used to show the results. the Pi’s have been connected via a router as we are on a managed wifi at uni and proves complicated to work with.
every tutorial i find is for installing all this one the one device and it monitors itself.

It would be greatly appriecated if someone could show me how to direct metrics from Pi 1&2 to the 3rd. also I am under the assumption that with my token, org and bucket that this is where my data is going to be sent to, please corrected me if I’m wrong and i need to create a DB inside the bucket

eventually when this is all working i want to test the performance of a couple file/data sharing methods and see where they max out hence i want to have my monitoring tools elsewhere

Hi @Wungez ,
Welcome to the community and glad to hear your tackling your first project with Telegraf and InfluxDB. Just a few assumptions:

  1. Since you mentioned buckets I assume you are using the latest and great InfluxDB OSS (2.0.9)
  2. Your network does not have a firewall blocking communications between your devices.

Lets first tackle Telegraf. To send data from PI and P2 to P3 you will need to do the following:

  1. Setup your input plugins
  2. Setup your Influx output plugin to point remotely

Here is an example config doing that:

# Global tags can be specified here in key="value" format.
  # dc = "us-east-1" # will tag all metrics with dc=us-east-1
  # rack = "1a"
  ## Environment variables can be used as tags, and throughout the config file
  # user = "$USER"

# Configuration for telegraf agent
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "5s"
  flush_interval = "10s"
  flush_jitter = "5s"
  precision = ""
 hostname = ""
  omit_hostname = false
  debug = true
  quiet = false

# Read metrics about cpu usage
  ## Whether to report per-cpu stats or not
  percpu = true
  ## Whether to report total system cpu stats or not
  totalcpu = true
  ## If true, collect raw CPU time metrics
  collect_cpu_time = false
  ## If true, compute and report the sum of all non-idle CPU states
  report_active = false

  ## The URLs of the InfluxDB cluster nodes.
  ## Multiple URLs can be specified for a single cluster, only ONE of the
  ## urls will be written to each interval.
  ##   ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
  urls = ["http://<insert pi-3 IP here>:8086"]

  ## Token for authentication.
  token = "<make-sure-to-generate-a-token>"

  ## Organization is the name of the organization you wish to write to.
  organization = "<org-you-configured-on-setup>"

  ## Destination bucket to write into.
  bucket = "<bucket-you-created>"

1 Like

The above config can be applied to Pi-1 and pi-2. Just change out the input plugins to the ones you need. Hopefully, this gets you started. Drop me a note if you want to discuss further :slight_smile:

thanks mate it did help me along. i think our Pi with telegraf is ok but no data seems to be coming into influx. i see instructions to add a data base but i always come back an an invalid command. how does one make a shell to make a database inside the bucket?
thanks again for the help :slightly_smiling_face:
*edit got a DB now. just gonna keep trying to load in the data. still seems a bit blank on grafana

Are you using InfluDB 1.X or 2.X ? As databases are only used within 1.X. If that is the case you need to use Influx 1.X output plugin in Telegraf :slight_smile:

influx version shows CLI 2.0.9 here so I’ve gone on a little sideways. this is some out i have from my Pi so i think that is working.

pi@raspberrypi:~ $ telegraf -test -config /etc/telegraf/telegraf.conf --input-filter cpu
2021-11-04T13:34:10Z I! Starting Telegraf 1.14.2

cpu,cpu=cpu0,host=raspberrypi usage_guest=0,usage_guest_nice=0,usage_idle=94.00000000023283,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=0,usage_user=5.999999999994543 1636032851000000000
cpu,cpu=cpu1,host=raspberrypi usage_guest=0,usage_guest_nice=0,usage_idle=94.00000000023283,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=0,usage_user=5.999999999994543 1636032851000000000
cpu,cpu=cpu2,host=raspberrypi usage_guest=0,usage_guest_nice=0,usage_idle=97.99999999959255,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=0,usage_user=1.999999999998181 1636032851000000000
cpu,cpu=cpu3,host=raspberrypi usage_guest=0,usage_guest_nice=0,usage_idle=97.99999999962165,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=0,usage_user=1.9999999999690772 1636032851000000000
cpu,cpu=cpu-total,host=raspberrypi usage_guest=0,usage_guest_nice=0,usage_idle=97.9487179483123,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=0,usage_steal=0,usage_system=0,usage_user=2.0512820512679393 1636032851000000000

whats the best test to do to know if the data is reaching influx?

This looks good, I assume you’re running Telegraf normally as a service? Rather than running the command line with the -test flag enabled? What you can do is check the service logs for both Telegraf and InfluxDB. Let’s see if those hold any clues as to why you might not be seeing data.

Could you also send me your Telegraf config (without your secure token). I can validate it for you :slight_smile:

did a restart and tried again to see how things were acting and received this error

[agent] Config:
Flush Interval:10s
2021-11-04T13:55:20Z E! [outputs.influxdb_v2] when writing to [http://localhost:8086]: Post http://localhost:8086/api/v2/write?bucket=monitor&org=josh: dial tcp [::1]:8086: connect: connection refused
2021-11-04T13:55:20Z E! [agent] Error writing to outputs.influxdb_v2: Post http: /localhost:8086/api/v2/write?bucket=monitor&org=josh: dial tcp [::1]:8086: connect: connection refused

came across another post and they were saying the error was with where it was writing to. i think i may have come across my error. im think the bucket was not entered correctly so ill fix that one up

@Wungez by the looks of things you are still pointing your InfluxDB output plugin to localhost. Is that correct? My assumption was InfluxDB was on PI 3 and Telegraf was on PI 1 and PI 2. There for Telegraf should point to PI 3’s IP.


urls = [""]

(post deleted by author)

yep so in the telegrapf config we added the output location. i honestly feel like i running around in circles. I’ve just tried to send you a message over this community page but i think it is broken.
we have been able to send the data to influx now but no stuck with grafana. had downloaded a few dashboards but it won’t seem to fill in the data.
I’m in Aus (not sure where you are in the world) but is there any chance we could have a chat over discord or something? my mate and i are just banging out heads against the wall cause we are pretty stuck. i feel like a quick call and you’ll be able to work out my errors. if your able to send me an email logija5138@cyadp.com (this is obviously a temp one) or if you give me a temp email i can send my discord id through and we could have a quick chat?

edit* a friend who is help me is trying to create a shell and all the documentation we have found says we only need to input "influx"but the command isn’t there. just really confused trying to follow the docs