You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exec plugin should forward any output of stderr, especially in the case of errors.
Current behavior:
[[inputs.exec]]
commands = [ "./test.sh" ]
#!/bin/shecho"Error message">&2exit 1
$ ./telegraf -config test.conf
[...]
2018-03-02T15:57:20Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command './test.sh'
2018-03-02T15:57:30Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command './test.sh'
Desired behavior:
$ ./telegraf -config test.conf
[...]
2018-03-02T15:57:20Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command './test.sh'
2018-03-02T15:57:20Z E! './test.sh': Error message
2018-03-02T15:57:30Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command './test.sh'
2018-03-02T15:57:30Z E! './test.sh': Error message
Use case: [Why is this important (helps with prioritizing requests)]
Probably a lot. In my case, I have a small C executable that does some non-trivial initialization work that can fail for quite some different reasons. Getting error messages on the log would speed up finding the problem and even allow pathological analysis (why didn't we get data at that time?).
The text was updated successfully, but these errors were encountered:
I might be able to contribute this feature but I first wanted to discuss if it's worth it. I'm not sure either if it's just as simple as adding the output in the exec plugin...
I think this is a good idea, but we need to make sure that we gracefully handle the case where there is lots of output to stderr. Probably just need a limit of something like 512 chars and make sure the output is utf-8 encoded. I would also add it to the exiting error to it's one line:
E! Error in plugin [inputs.exec]: exec: exit status 1 for command './test.sh': error message
Proposal:
The
exec
plugin should forward any output of stderr, especially in the case of errors.Current behavior:
Desired behavior:
Use case: [Why is this important (helps with prioritizing requests)]
Probably a lot. In my case, I have a small C executable that does some non-trivial initialization work that can fail for quite some different reasons. Getting error messages on the log would speed up finding the problem and even allow pathological analysis (why didn't we get data at that time?).
The text was updated successfully, but these errors were encountered: