gentux31 wrote:
>
> When I receive an ospfIfStateChange event I want to strip of the ip address
> (x) which is at the end of the oid (i.e. 1.3.6.1.2.1.14.7.1.1.x.x.x.x.y )
>
> However there is also a trailing zero (y). How can I strip this one of?
>
> This is what my rule looks like:
>
> for attr in dir(evt): if attr.startswith('1.3.6.1.2.1.14.7.1.1.'): evt.ospfIp
> = attr.replace('1.3.6.1.2.1.14.7.1.1.', '') evt.summary = "ospfIfStateChange
> from " + evt.device + " at " + evt.ospfIp
>
You're 95% of the way there. Try this one.
Code:
for attr in dir(evt):
if attr.startswith('1.3.6.1.2.1.14.7.1.1.'):
evt.ospfIp = attr.replace('1.3.6.1.2.1.14.7.1.1.', '')[0:-2]
evt.summary = "ospfIfStateChange from %s at %s" % (evt.device,
evt.ospfIp)
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=19066#19066
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users