-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_suprocess_output does not have a way to provide stdin #3430
Comments
This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. |
Hallo @gotyaoi, can you elaborate more on your use case? Are you trying to write a new integration/custom check that requires running a pipeline? |
Yes, we've written a custom check (not integration) based on an already existing nagios check we had that operates on pkcs12 files. It does this by calling out to the openssl binary, once to get the x509 from the pkcs12 and once to get information from the x509. This could be done in python using the cryptography library, but the version included with datadog is only 2.3.1 and the pkcs12 support didn't show up until 2.5. We've managed to work around it in this case by calling openssl to get the x509 data, then loading the x509 data into cryptography and getting the information that way, but that wouldn't be possible in other cases where we just needed to use installed system utilities. |
In this specific case. However, I wonder about situations where the utility used is not covered by a package that comes with the agent. You'd have to add entirely new libraries for each case, which seams troublesome in future. |
Hallo @gotyaoi, thanks for your quick response. Let's not get ahead of ourselves, you can open a new issue if or when that happens. I'm closing this issue now as I understand 6.13 release will solve it. Please feel free to reopen if that is not the case. |
This is a feature request, so have not included the debugging information.
Simply put, the get_suprocess_output function (https://github.com/DataDog/integrations-core/blob/master/datadog_checks_base/datadog_checks/base/utils/subprocess_output.py#L27) gives no way to provide stdin to a subprocess. The use case I have in mind is running a pipeline. Since the docs explicitly say that the command is run without a shell, you couldn't do it with a shell pipeline, so the only option is to capture the output of one command and manually pass it to another, emulating the pipeline.
The text was updated successfully, but these errors were encountered: