18 Oct 2018 04:33 PM - last edited on 19 May 2021 03:32 PM by MaciejNeumann
Hi. I am wondering what the best approach is to plug a shell script in to Dynatrace.
Our Linux sys admin is writing a shell script that returns a value (1 or 0). If the value is 1, then I would like to generate a problem within Dynatrace and raise a custom error alert. Is this possible and, if so, what series of steps would I need to implement?
Many thanks, Cam
Solved! Go to Solution.
18 Oct 2018 04:42 PM
Hello, it is possible to send an event to Dynatrace via the API. I recommend you this link :
18 Oct 2018 05:05 PM
Hiya. I shoudl have added - the shell script already exists (in fact there are many). It has no HTTP client provision to call in to APIs.
19 Oct 2018 07:28 AM
Apart from the API @ACKERMANN M. mentions, there is the option to write your own plugin that is executed by OneAgent. However, just for parsing 1/0 value from a single script, this is quite a big effort. If it's feasible for you, you can also use this generic execution template for that:
https://github.com/Dynatrace/Dynatrace-Generic-Exe...
Dynatrace has no option to execute arbitrary scripts or commands on monitored systems, except for oneagents/activegate plugins for security reasons.
19 Oct 2018 01:52 PM
Hi Julius, I think this can certainly act a s a good starting point. Thank you so much for the github url.