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

This product reached the end of support date on March 31, 2021.

Gathering metrics with the generic execution monitor

geoffrey_ketel1
Newcomer

Hi,

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:

  • executionSucces (Returns depending on Monitor's configuration if execution was successful (based on regex pattern matching of result).
  • returnCode
  • returnedMeasures

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 "

Retrieved measurements:

executionSuccess: 1.0
returnCode: 0.0
returnCode (Return Code,returnCode): 0.0

returnedMeasures: null

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.

7 REPLIES 7

eugene_turetsk2
Inactive

Hi Geoffrey,

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:

  • The system profile in question;
  • The server log file;
  • The collector log file where an instance of the monitor plugin is configured;
  • The GE plugin FINER log file.

You can send created support archive to eugene.turetsky@dynatrace.com.

Eugene.

tarjei_utnes
Organizer

Is the returned measures a way of recording something? I am very unsure how to apply this to something. Is it documented anywhere?

Hi

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:


Geoffke
Participant

Hi Tarjei,

Not sure what your question is. But in the meantime I've got this working.

Thinking of the Returned Measures, parameter. How is this configured? Is it possible to create measures for this? If so how?

You get measures created automatically. I used this to pull data from DCRUM once and plot in AppMon.

Enrico_F
DynaMight Pro
DynaMight Pro

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:

Quote:

"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.