Hi Mike,
Now I get it. Here's a simpler version:
evt.summary = "Memory usage is %s%%." % evt.iveMemoryUtil
You can set the "Rule" section to be a matching python condition.
For example:
hasattr(evt, 'iveMemoryUtil') and evt.iveMemoryUtil > 70
In this way, you can set the severity of events based upon the values in
the event.
-Eric
Mike Fratto wrote:
Ok, I was poking around on a different problem that I just posted a
question about and was reading through the zentrap.log file. I found a
bunch of errors in there like this:
2006-12-05 14:01:18 ERROR zen.Events: Error transforming
EventClassInst memUtilNotify (cannot concatenate 'str' and 'int'
objects)
googled "python int to string" making the assumption that the trap
value was the int, and modified the transform rule like this:
evt.summary = "Memory usage is " + str (getattr(evt,"iveMemoryUtil"))
+ "."
which results in summary message like this "Memory usage is 71", which
is what I want. :)
Of course, what I am finding is that the roll-ups aren't happening
because each message is different so I will probably have to modify
the transform a bit (I wonder if I can set-up an "if ... else" or
"switch" type set of conditions? and base the summary off that such as
"if iveMemoryUtil > 70 <=70 then summary is 'Memory reach 70%', and so
on) but it's a start.
Now about my other issue ... ;-)
mike
On 12/6/06, Mike Fratto <[EMAIL PROTECTED]> wrote:
Hey Eric, what I generally want to know is how (the syntax) to
transform the message so that it is meaningful to me when I scan the
events. There are other traps I would want to do something similar
with.
Specifically, I want to be able to transform the default message to
"Memory utilization has reached <the value of the SNMP trap>" I can
transform the the message with static text.
The data taken from the Event->Details tab is
Field Value
iveMemoryUtil 75
snmpTrapOID .1.3.6.1.4.1.12532.251.21
Thanks.
On 12/6/06, Eric Newton <[EMAIL PROTECTED]> wrote:
> Hi Mike,
>
> This will probably take a couple of round trips to answer. What value
> do you want to change on the trap?
>
> (I have already made a note that the section needs to be updated,
> especially the last paragraph).
>
> -Eric
>
> Mike Fratto wrote:
> > Ok, I am trying to the value from an SNMP trap that I want to use to
> > transform the summary. I read the manual section 8.3 (specifically
> > 8.3.4) and I read through the source (but not being a python
> > programmer, I don't fully grok it).
> >
> > What am I missing?
> >
> > Thanks.
> > _______________________________________________
> > zenoss-users mailing list
> > [email protected]
> > http://lists.zenoss.org/mailman/listinfo/zenoss-users
> >
>
> _______________________________________________
> zenoss-users mailing list
> [email protected]
> http://lists.zenoss.org/mailman/listinfo/zenoss-users
>
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users