I am using the generic execution plugin. I have an .exe that I want to run as an incident action. I am struggling to get AppMon to execute my .exe as an action. However, everything fine if I use the same .exe as a monitor.
I have the agent, collector, and server all running locally on my laptop. I assigned admin rights to the collector service. By setting a monitor (as a test), I was able to prove that DT can execute my custom executable using the plugin without an issue. But I am not getting the same results when it executes as an action.
I do not see anything written in any log files to give me a clue as to the cause of the problem. Maybe there is something about how the incident action is handled that I do not understand. What advice do you have for troubleshooting the generic execution plugin when it's used with an incident action?
What version of the Generic Execution Plugin are you using? I recently released an update to it, here: https://community.dynatrace.com/community/display/DL/Generic+Execution+Plugin
I didn't change anything about the way commands are executed, but I'm happy to help debug this with you. I'm using this plugin to run .EXEs at two different companies successfully. The same line of code that executes the command as a "monitor" will execute the command as an "action", so I'm sure we can get this working.
NOTE: Actions execute on the AppMon server, not on the AppMon collector. This is probably OK for your test since you're all on one machine, but this is something to keep in mind as you deploy.
First: create an incident that you are sure will fire. I typically set one up for "Low Memory", where I give a threshold to the "Memory Utilization" measure of the JVM of something like 10%
Next: set up an action for the incident, just so we can see if simple things are working.
Here's the BAT file, which you should put in C:\
(Contents of the bat file are simple, in case this link doesn't work:
echo %* >> echoMyArgs.out
This should write lines like this to c:\echoMyArgs.out:
C:\myAction.exe [DTServer: rvollum] [SystemProfile: easyTravel]
Let me know how this works.
We’re trying to create a incident that use the Generic Plugin as an action to start a vbs that remove all the log files in a filesystem when this one is almost full. The problem is that our dynaTrace’s server is in Linux box and the server that will be clean by the script is Windows, and when we use the psexec to run the vbs it doesn’t work, because the psexec it’s a window’s default app. Do you know another way to do it? We are trying to use the Expect, the action will call a expect script that will send the telnet connection with our dT collector, and this one will send the commando to run the vbs. Another question is how can we identify the host that is alerting through the expect script.
In your case you might be better of implementing your own action plugin. The Action plugin will receive detailed information about the incident including the measures that triggered the incident.
If you want to go that route check out the documentation on User Plugins: Manage and Develop User Plugins
The plugin itself is a Java Class that you implement. You are free to do whatever you want in that code. Remember - it will be executed in the dynaTrace Server once the Incident is triggered.
As Andreas said, it may be better to write a plugin that does exactly what you want. I don't know if the Generic Execution Plugin will do what you want here, but if you want to try, here is how I would do it.
The plugin is simply executing a command for you, and the important part is that it's executing it on the dynaTrace server. So what I would suggest is that you login to your dT server, and create/test your Expect script from the command line. In other words, create an Expect script that will connect to your Windows box and delete the log files that you want to delete. When you get that working, then use that same Expect script invocation as the arguments for your Generic Execution Plugin. You can use the parameter APPSRV in the GEP to refer to the server that caused the alert.
I am using this generic exec plugin as an action in the incident rule in order to execute a execute file with some parameters. I need to use dT parameters to generate a output file, such as %PROFILE, %MSG, %MEASURE. I'd tested them but %MSG and %MEASURES do not working. Does anyone know how can I implement this?Thanks in advance. Regards, Monica
I don't have enough information here to tell what is wrong, but I can tell you what my past experience has shown. Typically, when your action fails mysteriously, it's because there is some special character in the text that you are trying to substitute that causes the execution of your script to fail. For example, if the MSG or MEASURES variable returned text that included (for example) a | character (pipe character), that would get fed to your script and interpreted however your OS and/or script interpreted it.
Best thing would be if you could take a look at what you expected to be returned for substitution from MSG or MEASURES and see literally what that is, and what effect it would have if passed to your script.
Please let me know what that text is.
Hi @Rob V.,
I have a similar issue as Ryan did in which my script is running perfectly with this plugin through a task and with a monitor. However when I ran it as an action, it didn't work (but I did get an incident email). I didn't change any configuration. The script just writes to a log file.
Also, for the task (which runs fine), I configured it to trigger an incident but nothing shows up.