Hi Jim,

 

Your rationale for why it's not a good idea to do this makes sense.

 

We've already implemented using CreateEventWithAttributes since we knew
how to do that already.

I was just trying to reduce the number of custom events that we had to
create.

 

Thanks!
--Mark S

 

________________________________

Mark Serencha - Inforonics LLC - (m) +1-781-439-0519 - (w)
+1-978-698-7418 -  [email protected]
<mailto:[email protected]> 

 

From: Pfleger, Jim [mailto:[email protected]] 
Sent: Thursday, July 29, 2010 11:20 AM
To: spectrum
Subject: Re: [spectrum] Can you add Attributes to the current Event with
an EventProcedure?

 

Mark-

We tried to solve this exact problem (extracting several values from a
single varbind), and we were only able to do that by creating a new
event. I don't know of any event procedures or other tools that will let
you add values to an existing event. Not even the CORBA API has a method
to modify an event. I suspect this is intentional because what would be
the expected behavior if an event is modified by the EventDisp, or even
later? Should it run through the EventDisp again? Is it still "new"
then? By not allowing  modification of events, CA has prevented a number
of sticky problems.

Is there a reason you want to modify the event in place, rather than
generate a new event? To extract several values at once, all we did was
string together a long line of CreateEventWithAttribute() calls with
GetRegexp() calls to create the new event in one step. We also don't log
the original event. It was hard to get going at first, because of how
unforgiving the EventDisp syntax is, but it's working well now.

HTH,
Jim



On 7/28/10 10:08 AM, "Mark Serencha" <[email protected]>
wrote:

Hi List,
 
This is a follow-up to a recent post.
 
Other than invoking CreateEventWithAttributes, which requires creating a
new event using values from the current event,
do you know of a way to set values for NEW event variables on the
CURRENT event?
 
e.g. if I receive an event with one variable, which I need to pick apart
into several values,
I presently need to create a new event with the values inserted into
individual variables, 
as Jim demonstrates below in answer to Brad. (see list topic "Passing
Attributes in Event Messages")
 
I have experimented with this unsuccessfully, but I don't have access to
my code samples right now.
But has anyone on this list ever implemented an EventProcedure which
attaches variables to the CURRENT event?
 
Thanks,
--Mark S
 

________________________________

Mark Serencha - Inforonics LLC - (m) +1-781-439-0519 - (w)
+1-978-698-7418 - [email protected]  <
mailto:[email protected]> 


From: Pfleger, Jim 
Sent: Wednesday, July 28, 2010 12:52 PM
To: spectrum
Subject: Re: [spectrum] Passing Attributes in Event Messages

Since SetEventAttribute() returns the entire attribute list, you can
keep nesting calls to it. The following is untested, but should do what
you're asking:

              0xffff0000 E 50 P "\
                 CreateEventWithAttribute(\
                  {C CURRENT_MODEL},\
                  {H 0xffff0001},\
                  SetEventAttribute(\
                    SetEventAttribute(\
                      GetEventAttributeList(),\
                      {U 111},\
                      ReadAttribute (\
                        {C CURRENT_MODEL},\
                        {H 0x11f7e}\
                      ),\
                      {U 112},\
                      ReadAttribute (\
                        {C CURRENT_MODEL},\
                        {H 0x10e40}\
                      )\
                    )\
                  )\
                )"



On 7/28/10 9:38 AM, "Gray, Brad" <[email protected]> wrote:
Greeting all,
 
I'm trying to pass two attributes in an event message, ifAlias (0x11f7e)
and ifOperStatus (0x10e40).  I understand it can be done by using an
event procedure, but cannot get the syntax working correctly. Does
anyone have an example of how to pass two attributes?  I found the
following and have tried adding in a second attribute, but the code is
not working as expected.
                
                0xffff0000 E 50 P "\
                  CreateEventWithAttribute (\
                  {C CURRENT_MODEL},\
                  {H 0xffff0001},\
                     SetEventAttribute(\
                     GetEventAttributeList(),\
                     {U 111},\
                     ReadAttribute (\
                     {C CURRENT_MODEL},\
                     {H 0x11f7e})))"
 
Kind Regards,
Brad
 
Bradley Gray
Distributed Computing Analyst III
ETA Network Support

 
 
_____________

The information contained in this message is proprietary and/or
confidential. If you are not the intended recipient, please: (i) delete
the message and all copies; (ii) do not disclose, distribute or use the
message in any manner; and (iii) notify the sender immediately. In
addition, please be aware that any message addressed to our domain is
subject to archiving and review by persons other than the intended
recipient. Thank you.
_____________

*       --To unsubscribe from spectrum, send email to [email protected]
with the body: unsubscribe spectrum [email protected] 

 

*       --To unsubscribe from spectrum, send email to [email protected]
with the body: unsubscribe spectrum [email protected] 


---
To unsubscribe from spectrum, send email to [email protected] with the body: 
unsubscribe spectrum [email protected]

<<image001.png>>

Reply via email to