Hi,
Can anyone suggest how can we capture the output of the generic command we are executing? I mean if I'm configuring email alert for some generic command, can I pass the output in the email message body?
Please suggest.
Regards,
Answer by Don M. ·
I am not a programmer, and I really do like the Generic Execution Plugin, I too need to figure out a way to get what is returned in the detailed message section of the GEP. I am currently running scripts remotely that return a single number, and it is displayed on the message detail. You suggested "altering" the GEP to only execute commands known to give numeric responses (From the script I am executing, I have that covered, my question is what do I alter, and more importantly, How do I alter it.
If you could explain how to do this I'd be very appreciative.
Thank you
Don Meuth
Answer by Rob V. ·
Hi Nalin,
The thing about the Generic Execution Plugin is that it's "generic", and can run any command. The shape and type of the output is unknown to the GEP, so it may or may not be a single value, and may or may not be numeric. The idea is that you're allowed to process the output (with a regex) and come up with a determination of success or failure that you reflect in the return measure, "executionSuccess".
The GEP can and does capture the output so you can see that by looking at the result of the monitor running the GEP. You just can't include that output as part of measure processing. For example, here's the output of a GEP running the "ping" command testing for availability of a server:
As you suggest, you could alter the GEP to only execute commands known to give numeric results, and create a measure (or set of measures) to capture those results. You might be better off starting with the Windows or Linux Performance Monitor plugins as a model however, rather than the GEP.
Rob
Answer by Andreas G. ·
Hi Nalin
I dont think this is possible right now. Your Generic Executor acts as a Monitor and with that returns measure values (0 or 1 in your case).
The email is an Action that will be sent in case the measure value (0 or 1) exceeds a certain threshold. There is no way for the Action Plugin to get more contextual information from the Generic Execution Command
What you could do is create your own Action Plugin that sends an email. in that plugin as a first step you try to capture additional information that you want to include in the email text, e.g: you could re-execute the command monitored by your generic executor.
Not sure if this is what you want - but - at least it is a thought for a workaround
Andi
Hi Andreas
Currently I am not able to concentrate on this. But if we see the linix monitoring plugin it does allow to capture data as it has the measure which stores the data. Now the time I will spent (when I get) is to modify the GECP to apply the same changes as in linux monitoring.
Regards
Nalin
Answer by Nalin A. ·
Hello Andreas,
The default measure for Generic Command Execution is "executionSuccess" whose output is either 0 or 1. Since this is the only measure available we have set incident on success criteria of this measure and as a result we always get the value of "executionSuccess" in mail.
Can you please suggest a way to pass the captured command output to mail?
Regards
Answer by Andreas G. ·
Hi Nalin
Can you be a bit more specific on your use case?
You can for instance execute a Generic Command on a scheduled basis using our Generic Monitor Plugin. The plugin will execute a cmd line and will return a value from the output. This value will be seen by dynaTrace as Measure returned from your monitor. You can then create an Incident based on that measure. When you define an email alert action you will receive the actual measure value that your command returned in case the value exceeds your defined threshold.
Let me know if this helps
Hello Andreas,
Thanks for reply. Let me check and confirm you back on this.
Regards
JANUARY 15, 3:00 PM GMT / 10:00 AM ET