I created a small conf file that runs a bash script.
Inside the script I run a basic command as follows:
I have placed the bash file inside /etc/telegraf/scripts folder.
When I run the test command Incan see the correct output as follows:
however I am not seeing values for taga pid and program in the Influx DB.
Influx - 2.2
Telegraf - 1.23.1
OS - Ubuntu 20.04
Would appreciate sone insight as to what and how I can check to debug why the pid and program tags are not showing in the influxdb.
It would help to see the snippet of Telegraf conf code you are using to do this. You can set
debug = true in the
[agent] section which might show more details during runtime.
hi @phill thanks for your reply.
i updated telegraf.conf to have debug = true.
however can you specify where can i see logs ?
i am on Ubuntu 20.04.4 LTS version.
my conf file which is in telegraf.d looks like as follows:
commands = [“/etc/telegraf/scripts/getOpenPorts.sh”]
timeout = “60s”
data_format = “influx”
I run in a docker container and this is a sample of what I see on the terminal (stdout)
2022-07-02T00:07:05Z I! Using config file: /etc/telegraf/telegraf.conf
2022-07-02T00:07:05Z I! Starting Telegraf 1.23.0
2022-07-02T00:07:05Z I! Loaded inputs: http
2022-07-02T00:07:05Z I! Loaded aggregators:
2022-07-02T00:07:05Z I! Loaded processors:
2022-07-02T00:07:05Z I! Loaded outputs: file
2022-07-02T00:07:05Z I! Tags enabled: host=ad61a2f4ac4c
2022-07-02T00:07:05Z I! [agent] Config: Interval:10m0s, Quiet:false, Hostname:"ad61a2f4ac4c", Flush Interval:2m0s
2022-07-02T00:07:05Z D! [agent] Initializing plugins
2022-07-02T00:07:05Z D! [agent] Connecting outputs
2022-07-02T00:07:05Z D! [agent] Attempting connection to [outputs.file]
2022-07-02T00:07:05Z D! [agent] Successfully connected to outputs.file
2022-07-02T00:07:05Z D! [agent] Starting service inputs
My output plug-in is enabled as follows:
files = ["stdout"]