cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Alerting on a Linux shell script

campbell_purvis
Contributor

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

 

4 REPLIES 4

Matthieu_Acker1
Newcomer

Hello, it is possible to send an event to Dynatrace via the API. I recommend you this link :

https://www.dynatrace.com/news/blog/trigger-dynatrace-problem-alerts-from-external-sources-using-eve...


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.


Julius_Loman
Leader

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.


Hi Julius, I think this can certainly act a s a good starting point. Thank you so much for the github url.