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]

<<image.png>>

Reply via email to