Discussion:
transform bases on device class
ignacio freyre
2013-09-23 20:50:40 UTC
Permalink
ignacio freyre [http://community.zenoss.org/people/nachofw] created the discussion

"transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74737#74737

--------------------------------------------------------------
hi, need some help with a transform that is not working.
I want to drop events bases on device class, if device class starts with '/Network/Remote_site_A' or '/Network/Events' i want the event dropped.
What i got:

if evt.DeviceClass.startswith('/Network/Remote_site_A')
or evt.DeviceClass.startswith('/Network/Events')
evt._action = 'drop'

zenoss 4.2.4 is marking the transform box in red.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74737#74737]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Andrew Kirch
2013-09-23 20:53:17 UTC
Permalink
Andrew Kirch [http://community.zenoss.org/people/akirch] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74738#74738

--------------------------------------------------------------
Hi,

Why are you using device classes instead of Locations to differentiate sites?  Simply drag stuff for "remote site A" to a "remote site A" location and create your transform.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74738#74738]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ignacio freyre
2013-09-23 21:17:29 UTC
Permalink
ignacio freyre [http://community.zenoss.org/people/nachofw] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74739#74739

--------------------------------------------------------------
that is because i have applied different monitoring templates based on device classes organizers. there are many sub-classes under /Network/Events.

What i want is to drop events from those device classes, events that are coming from thresholds on
ethernetCsmacd_64 template.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74739#74739]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2013-09-24 02:32:07 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74743#74743

--------------------------------------------------------------
Try something like:

if "Remote_site_A" in getattr(evt, 'deviceclass', ''):
   evt._action = "drop

I'm away from my perspective but will check the syntax tomorrow.

However Andrew is right, you are over complicating it...
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74743#74743]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ignacio freyre
2013-09-24 13:09:00 UTC
Permalink
ignacio freyre [http://community.zenoss.org/people/nachofw] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74717#74717

--------------------------------------------------------------
That transform is doing his work, i'm not getting events from that device class for 'interface errors' alerts:

if "/Network/remote_sites" in getattr(evt, 'DeviceClass', ''):
   evt._action = "drop"

Maybe i wasnt explaining myself very clear (i'm translating from spanish).
I have made about 5 different device classes so i can bind templates depending on the devices requirements.
e.g:
/Network/Remote_sites
/Network/Branchs
/Network/Headquarters

Remote sites are around 800 devices that i dont want 'interface error' alerts from, but i do want 'interface errors' alerts from /Network/Headquartes.
I'm also doing the same for rta alerts. i only get them for /Network/Branch.

I dont think i can do that with locations or can i ?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74717#74717]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2013-09-24 15:20:29 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74746#74746

--------------------------------------------------------------
The simplest method would be to put the below transform under the
/Perf/Interface (or the EventClass of your choice)

if "/Network/Remote_sites" in getattr(evt, 'DeviceClass', ''):
   evt._action = "drop"

That will drop any events for the /Perf/Interface EventClass for devices
under the /Network/Remote_sites DeviceClass.

Make sense?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74746#74746]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ignacio freyre
2013-09-24 16:08:16 UTC
Permalink
ignacio freyre [http://community.zenoss.org/people/nachofw] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74747#74747

--------------------------------------------------------------
yes that is what i did and is working great!
thanks for your time!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74747#74747]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
hydruid
2013-09-24 16:42:39 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: transform bases on device class"

To view the discussion, visit: http://community.zenoss.org/message/74748#74748

--------------------------------------------------------------
Glad to hear!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74748#74748]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...