I was having a hard time getting my CPU temperature information using MSAcpi_ThermalZoneTemperature… apparently my motherboard doesn’t support it.
So I ended up putting together a little program that uses CoreTemp’s shared memory interface. I relied heavily on a library and sample code put together by Michal Kokorceny from http://74.cz/.
When Telegraf won’t start, that’s usually because there’s a problem in the .conf file(s).
I believe you need spaces to indent the lines below [[inputs.exec]]. I don’t know if it’s picky, but I have two spaces preceeding the “commands” line and the “data_format” line. Try that and see if it works!
I have indentation of two spaces as well. But I’m sure that isn’t the problem.
I also tried to to move it to different (non-C:) drive with no avail. commands = [ "D:\CoreTempTelegraf" ]
I’m starting thinking this is permission issue of your exe file. Even tho I’m Admin on this PC.
Telegraf starts up just fine if I comment out your three lines.
When I was having permission issues with the program, it wasn’t preventing Telegraf from starting; rather, Telegraf would start but would collect no data from the program.
Can you try adding timeout = "5s"
below the “data_format” line? I didn’t think that was required, but maybe it is.
C:\Program Files\telegraf>telegraf --test --config CoreTempTelegraf.conf --console
2020-06-19T15:28:47Z I! Starting Telegraf 1.13.3
2020-06-19T15:28:48Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 1:103: "coretemp_cpu,host=BEDAS,cpu=Intel_Core_i5_4670K_(Haswell) cpu_speed=3806,fsb_speed=100,multiplier=38,0,vid=1,15"
2020-06-19T15:28:48Z E! [telegraf] Error running agent: One or more input plugins had an error
EDIT: I see it now. It is my locale. My system uses decimal comma, not decimal dot.
So it’s that vid value causing the problem. I believe I can put that value in double quotes so it can be parsed correctly. I should be able to have an update by the end of the day!
I’ve posted an updated .exe to my site (tomk.xyz) that I believe will fix your problem. Would you mind checking it out and let me know if it’s working?
I declared a local TFormatSettings with a DecimalSeparator as a period, and then used those format settings for the output.
I am trying to use your tool and unfortunately I get an error message when starting Telegraf.
I have inserted the passage in the telegraf-conf. your tool also outputs the correct values. But when I run telegraf I get the error: “Error parsing data: line 253: invalid TOML syntax”.
I don’t know exactly, but can you try a test config file with just the [[inputs.exec]] section? I’m wondering if the incorrect TOML is in another section of your file.
Ahhh, I wonder if it’s your text file. I don’t think the file will save correctly with Notepad. Can you download/install Notepad++, and then create a new file with UTF8 encoding and Unix format end of line (EOL). Then you should be able to add the [[inputs.exec]] section and it should work!