I've setup a new monitor in Dynatrace 6.2 based on the Generic execution monitor. A script is triggered on a remote Linux server. Authentication works fine, running the script seems to be ok, but for some reason I'm unable to capture the output of the script.
Three measures were create for this monitor:
I'm pretty sure my other configuration settings are correct. Though the ones in relation to the measure I'm not that sure. Below you'll find my specific setting (test-setup).
I would think the data coming in would be matched to the returnedMeasures-measure and the return code of the script to the returnCode-measure. Furhtermore the Regex is set to (.*), which is the regular expression the command's output should be matched against. The way the regex is setup, it should capture data I would think. In my test setup the result would be 131.
The detail window of a run is shown as successful. This is the output I get in the "
returnCode (Return Code,returnCode): 0.0
Especially the "returnedMeasures" is causing a headache, since I would expect it to contain the returned value of the script.
When this works I'd like to setup up the monitor to capture multiple measures through the "***ReturnedMeasures:" option. But first things first. Capturing just 1 entry.
Has anyone setup the generic execution monitor to capture values from a script? If so, a simple example would be nice and appreciated.
Please read the first sections in the "New in plugin version 5.5.8" and "New in plugin version 5.5.9" notes on the plugin's home page here in order to get returned measures from the executed by the plugin command. In terms of getting output from the command: please make sure that you checked the "Capture Output" plugin configuration parameter.
Let me know if you have any further questions. If you do, please provide support archive which includes:
You can send created support archive to firstname.lastname@example.org.
You should first install the plugin extension of Generic Execution plugin as @Eugene T. has described, with the example (and with test.bat given simply prints 10 number values)
there you will have measures available as measure1, measure2..measure10, then you will click "Edit Returned Measures" and write measures with semicolon separated as below:
In the end you will see:
Does anyone know if/how this works for JSON output? I'm a bit confused due to the somewhat unclear comment about "JSON scripts" for 5.5.8:
"Added support for multiple return values from executed scripts as well as JSON scripts."
In the end, what I would like to achieve is parsing a command's JSON output for specific members and extract their numeric value as measures.The command in this case is a simple local invocation of "curl".
Is this possible without having to create a custom script which does all the parsing implicitly and returns the result measures as a comma-separated list?
Or is there perhaps another plugin that can do the same for HTTP requests directly? Unfortunately the default "URL Monitor" plugin is not capable of this.
Any feedback would be greatly appreciated.