TECHZEN Zenoss User Community ARCHIVE  

basic Transformation issues

Subject: basic Transformation issues
Author: [Not Specified]
Posted: 2014-04-03 04:29

[edit] ok, found my error. Seems like i'd need to put the transformation into the right window for the event class. Now it works. But i still couldn't figure one thing out: i monitor a web service via PHP-Script which gives me some Nagios-styled feedback after being called. How can i transform the given feedback into the event message Script called:

[zenoss@h0002-zenossp01 libexec]$ ./curl_response.sh importActivations
OK | httpcode=200 message=Job 'ImportNewActivations' with locale 'de-AT' called. Job 'ImportNewActivations' exited with 0 newly imported activations and 18 issues. Job run successfully.

I just want the text what is stored within the "message"-Perf variable as the event message. Any idea how to accomplish this

------------- original message ---------------

Ol,

i'm trying to do some basic transformation for events. But it seems like i'm missing something basic. Here's what i've done so far:

- went to my event class (App/Job)
- added a new Event Class Mapping called "BS1"
- under "transformation" i just added "evt.summary = "TEST"" for - obviously - testing purposes
- generated a few events within this event class

Sadly, nothing happens. Not one single event is transformated. Where i am going wrong :(

Regards,
toxic_garden



Subject: To make sure I understand....
Author: [Not Specified]
Posted: 2014-04-03 07:45

To make sure I understand.....you want to generate a new event, using a shell script, with the output from the script used for the event's message field

Here is an example on how to generate an event on the CLI:
zensendevent -d router1.example.com -s Critical -c /Status/Ping "Router down"

In the above example, "Router down" is the event message. Hope this helps!

Hydruid



Subject: Perhaps this thread will help
Author: [Not Specified]
Posted: 2014-04-03 08:59

Perhaps this thread will help: http://honglus.blogspot.com/2009/04/zenoss-monitor-remote-customized-app...

Many apologies, I'm not 100% sure how to do it the way you want to.

Hydruid



Subject: yes, it is a bit hard for me
Author: [Not Specified]
Posted: 2014-04-03 09:48

yes, it is a bit hard for me to describe. But thanks for trying to understand anyways.

I think i found some workaround. Here's my situation: my Shellscript returns "Job 'ImportNewActivations' with locale 'de-AT' called. | httpcode=200". This is what i want to have as the event summary. But when i use a threshold for the httpcode-perfdata, i just get an event containing "threshold exceeded" without the script output.

Now i got rid of the thresholds and check the returned perfdata via transformation. Events are now generated with each call as i added "exit 1" at the end of the script. This seems to work fine now and i can work with the script output the way i want to without having it overwritten by the threshold-events. ;)



< Previous
RPN Calculation help
  Next
import mib problem
>