Discussion:
Using Transforms, Event Classes
thunter0028
2013-10-29 19:39:08 UTC
Permalink
thunter0028 [http://community.zenoss.org/people/thunter0028] created the discussion

"Using Transforms, Event Classes"

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

--------------------------------------------------------------
I have a need to take events that normally increase in count, and take each of the individual event out and create a new event. Sounds confusing, but here is the example.

I have a device that controls our electronic door locks. Each time a handle is opened by the key pad, a trap is sent from the device. In Zenoss, this will read as eventClassMapping emka.2.221. We have 4 doors that we open with the key pad. Each time a different door is opened, the count goes up 1 and the Event Details will change.This is all fine and dandy, but what I am looking for is a new descriptive event each time an individual door is opened. I am including the details from Zenoss with this post. If you look at the count, 4 at the time, I had opened all 4 doors. Only 1 event was created, but I did notice that there were 4 emka.2.1.x.x.x.x.x.x.x.x.x.x events that showed each door individually (6150, 6151, 6160, 6161).

What can I do to create a new event for each instance (count) that occurs when a trap is sent? Can I use the emka.2.1.x.x.x.x.x.x to make them unique? If so how is it done?

Thanks in advance for your help.

Tony
--------------------------------------------------------------

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

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-10-31 19:46:27 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: Using Transforms, Event Classes"

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

--------------------------------------------------------------
Use a transform to put the events in different event classes like
/Network/Door/A

An example transform:
if "HP ETHERNET" in getattr(evt, 'component', ''):
   evt.eventClass = "/Ignore"

Replace 'HP ETHERNET' with unique text from the event, replace 'component'
with the part of the event with the unique test (i.e. eventClassMapping),
and replace '/Ignore' with the event class you want to move those events to
(i.e. /Network/Door/B)

Hope that makes sense!
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
thunter0028
2013-11-01 16:56:10 UTC
Permalink
thunter0028 [http://community.zenoss.org/people/thunter0028] created the discussion

"Re: Using Transforms, Event Classes"

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

--------------------------------------------------------------
This worked perfectly for the scenario I presented. Thanks a ton for the insight.

Now that I have a good idea of how to do the transforms, there is one more piece that is stumping me. In the event details of a different event we receive, I am trying to do the same thing and "remove" the details from the field "vmwVirtMachines" and insert into my transform. Here is an example of what I am trying to do:

if "vmwVmPoweredOff" in getattr(evt, 'eventClassMapping', ''):
   evt.eventClass = "/VMWare/Power State"
   evt.component = "(evt.vmwVirtMachines)"


(evt.vmwVirtMachines) should read the virtual machine that is listed in this field.I tried and tested the exact code above last night, and it didnt work. I suspect it is because "(evt.vmwVirtMachines)" is not correct to pull the value. Any ideas?

Loading Image... Loading Image...
--------------------------------------------------------------

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

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-11-02 11:22:01 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: Using Transforms, Event Classes"

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

--------------------------------------------------------------
I will see if I can find a sample of what you want!
--------------------------------------------------------------

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

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-11-02 11:23:48 UTC
Permalink
hydruid [http://community.zenoss.org/people/hydruid] created the discussion

"Re: Using Transforms, Event Classes"

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

--------------------------------------------------------------
Here is a basic example at this link

http://community.zenoss.org/docs/DOC-2558 http://community.zenoss.org/docs/DOC-2558

Let me know if that doesn't work!
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
thunter0028
2013-11-05 19:50:16 UTC
Permalink
thunter0028 [http://community.zenoss.org/people/thunter0028] created the discussion

"Re: Using Transforms, Event Classes"

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

--------------------------------------------------------------
I still have not been able to get what I am looking for. ALso, I have modified the transform due to the fact that each VM that is shutdown sends it own alert:

   evt.eventClass = "/VMWare/Power State"
   evt.summary = "Virtual Machine Powered Off"
   evt.component = " *????????* "

The ???? section of code needs to pull the data from the vmwVirtMarchines section of the Event Details, it will show in the component section on the dashboard.
--------------------------------------------------------------

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

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...