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

Generic execution plugin - Howto?

Hello,

I'm really struggling with this plugin, even executing a simple echo in a file doesn't looks to work.

What's wrong here?

11 REPLIES 11

JamesKitson
Dynatrace Leader
Dynatrace Leader

I've never used the multiline command option so I'm not aware of any issues. Have you gotten this to work at all? I find it easiest to work out issues by testing using this plugin as a task first and with something very simple such as a ping to make sure all of the settings are correct then moving it to a test incident and finally using it on 'real' incidents.

How is it failing currently? Do you see any messages in the plugin logs?

James

Well, I have no error message but it's not generating any plugin.txt file.

Whereas I have seen that before (https://answers.dynatrace.com/questions/174514/generic-execution-plugin-not-generating-log-files.html) I've never seen someone find a clear explanation/fix.

Thanks, the plugin txt is not the log file of the plugin this is the redirect of my echo.

Here is the plugin log but I don't find it too helpfull as it did show any error:

[GenericExecutor@com.dynatrace.diagnostics.plugin.extendedexecutor.GenericExecutionPlugin.action] execute method: STDOUT from the command '[echo, -e, Was 219.23ms but should be lower than 200.00ms. \n, Too slow Test Default Application \n, 0 \n, Business Transaction Results/Value: Too slow Test upper bound exceeded \n, -;Default Application \n, Too slow \n, >> /home/svc_dtstg/plugin.txt]'
is 'Was 219.23ms but should be lower than 200.00ms.
Too slow Test Default Application
0
Business Transaction Results/Value: Too slow Test upper bound exceeded
-;Default Application
Too slow
>> /home/svc_dtstg/plugin.txt
'
2017-04-19 12:08:01 FINER [GenericExecutor@com.dynatrace.diagnostics.plugin.extendedexecutor.GenericExecutionPlugin.action] execute method: STDERR from the command '[echo, -e, Was 219.23ms but should be lower than 200.00ms. \n, Too slow Test Default Application \n, 0 \n, Business Transaction Results/Value: Too slow Test upper bound exceeded \n, -;Default Application \n, Too slow \n, >> /home/svc_dtstg/plugin.txt]'
is ''
2017-04-19 12:08:01 FINER [GenericExecutor@com.dynatrace.diagnostics.plugin.extendedexecutor.GenericExecutionPlugin.action] execute method: returning success when isCapture is 'true'
2017-04-19 12:08:01 FINER [GenericExecutor@com.dynatrace.diagnostics.plugin.extendedexecutor.GenericExecutionPlugin.action] Entering teardown method

sooryaprabha_mo
Inactive

Hi Jonathan,

Attached the batch file and GEP configuration screenshot in monitors. Please try and share the results.The same thing worked in my environment.

test-echo-redirect.txt

gep-plugin.png

Thanks

Soorya Mohan

Thanks but actually, you're not calling an echo with dynatrace variable but calling a batch file with an echo inside which is quite different I believe. Have you been able to pass dynatrace variable to your batch file? How do you manage variable that contain blanck character?

Hi Jonathan,

Attached the GEP configuration screenshot and command to be added in "command" section.

"C:\xxxxx\m.bat"
${VIOLATED_MEASURE_NAME} ${AGENT_NAME} ${SYSTEM_PROFILE} ${SEVERITY}

Below are content used in batch file

echo "%3" "%4" "%2" "%1">> c:\xxxx\file1.txt

gep-config.jpg

Thanks

Soorya Mohan

Thanks Soorya, I still have no idea of why doing a direct echo call is not working but going via a shell script is indeed working.

Try cmd.exe /c echo "%1" "%2" ">> c:\xxx\file1.txt (or) cmd /c echo "%1" "%2" ">> c:\xxx\file1.txtin command section of GEP configuration. Hope this may works!!

Thanks

Soorya Mohan

Should you need to parse multi-line command before issuing it to shell/cmd object? 😛

don_bonin
Advisor

Make sure you are escaping your paths with DOUBLE \\ in the command section for Windows executions.

ie c:\\temp\\run_ping.bat

This worked for me - guess I missed this somewhere in the docs or comments along the way.

Then you can look in the plugin log (under system information) and you will see your output from the plugin and whatever you are trying to execute.

In order for logging to work I had to set the plugin logging to FINER (server settings >> plugins >> properties) see the LOG LEVEL option on the bottom of the page.