Inputs.exec not writing to database

Hi all,

I’m using Telegraf on Windows for the first time. The database is Influx on my Unraid server. In addition to the standard inputs.win_perf_counters, I am trying to get an inputs.exec working. The inputs.win_perf_counters are working as expected.

This is the inputs.exec that I added:

[[inputs.exec]]
  commands = ["CoreTempTelegraf"]
  data_format = "influx"
  timeout = "5s"
  interval = "10s"

The output from the “CoreTempTelegraf” command is:

coretemp_cpu,host=TOMPC2,cpu=Intel_Core_i5_6600_(Skylake) cpu_speed=3301,fsb_speed=100,multiplier=33.0,vid=1.05
coretemp_cpu,host=TOMPC2,cpu=Intel_Core_i5_6600_(Skylake),cpu_id=0,core_id=0,unit=C temperature=37
coretemp_cpu,host=TOMPC2,cpu=Intel_Core_i5_6600_(Skylake),cpu_id=0,core_id=1,unit=C temperature=38
coretemp_cpu,host=TOMPC2,cpu=Intel_Core_i5_6600_(Skylake),cpu_id=0,core_id=2,unit=C temperature=36
coretemp_cpu,host=TOMPC2,cpu=Intel_Core_i5_6600_(Skylake),cpu_id=0,core_id=3,unit=C temperature=35

However, this data is not being written to the Influx database. Running a “show measurements” command confirms that the “coretemp_cpu” measurement does not exist.

I have restarted the Telegraf service. I also ran a --test from Powershell, and it is outputting the data from “CoreTempTelegraf.”

What am I missing?

I figured out how to enable logging, and it turns out my command is returning an error when Telegraf runs it.

Does anybody know the user account that Telegraf uses to run commands in Windows? I can’t imagine what the problem is, since the command works fine in an unelevated command prompt.

Any ideas are appreciated!!

I got this figured out. It turns out there was an option I had to check in CoreTemp to make the shared memory available to all users.

I know you fixed it, but I think Telegraf runs as “Local system”

That is a problem if the script needs elevated permissions. I have a script to connect to a commvault server. Runs fine from powershell but would only run as a domain admin with telegraf (big no!) - We created a service account in the end but you can also set your scripts to self elevate. Just something to consider if you intend to use scripts that require elevation

1 Like

Good point! Thanks for the response!