0

I am trying to send the result of a script output via Telegraf to InfluxDB. I have added execd plugin to telegraf.conf and this config looks like this:

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10s"
  flush_jitter = "0s"
  precision = ""

  ## Logging configuration:
  debug = false
  quiet = false
  logfile = ""
  hostname = "10.10.10.10" #this is example url
  omit_hostname = false

[[outputs.influxdb]]
 urls = ["http://127.0.0.1:8086"] #this is example url
 
 ## Token for authentication.
 insecure_skip_verify = true
 database = "some_db"
 username = "some_username"
 password = "some_password"
[[inputs.cpu]]
  percpu = true
  totalcpu = true
  collect_cpu_time = false
  report_active = false
[[inputs.disk]]
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
[[inputs.diskio]]
[[inputs.mem]]
[[inputs.net]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]

#####
[[inputs.execd]]
  command = ["/bin/sh", "telegraf-apt.sh"]
  data_format = "influx"
  signal = "none"


[[outputs.file]]
  files = ["stdout", "/tmp/telegraf_output.out"]
  data_format = "influx"

[[outputs.execd]]
  command = ["/bin/sh", "telegraf-apt.sh"]
  data_format = "influx"

When I test the validity of this config, that is when I run the command telegraf --config telegraf.conf --test I can see the output of my telegraf-apt.sh script there. Nevertheless, when I connect to the corresponding Influxdb database and list all the measurements, I do not see anything from my script output there - I see all the measurements derived from input plugins from my telegraf.conf , such as cpu, disk, diskio, etc., but no measurement named execd. Could you please help me on solving the problem or at list give some hints that may clarify the situation? Thank you!

I am expecting to see my telegraf-apt.sh script output inside InfluxDB

Ben
  • 1

0 Answers0