I am trying to run the below exec plugin in telegraf client on windows but after updating and restarting it telegraf is stopping with below error. but the powershell command which i am using is executing in the powershell and giving output without any issues.
please help me in configuring this.
Your help is highly appreciated.
the call to powershell may require a full path name to the executable in order for telegraf to be able to locate the program itself. You can also try adding the path for powershell to the telegraf user’s PATH environment and see if that works as well.
I think your TOML syntax is not valid because a single/double quote inside the command closes the opening single/double quote that opens the command “value” of the array.
I suggest to put the command in a script file (.ps1) and call it in the exec, which should look like the command below:
I will give you two tips to avoid this kind of problem in the future:
Always run the command from the cmd (which is what the exec plugin will do) to check if that’s correct. If possible impersonate the user used by telegraf.
before restarting the telegraf service process you can test the edited configuration by using: