Sorry about this ­ this is my mistake. I copied and corrected what had been
posted originally, instead of checking it more closely, and I missed
something. All of the *Attribute functions are deprecated, and we¹re
supposed to use *Variable functions instead. For example
$SPECROOT/SS/CsVendor/CA/Procedures/GetEventAttribute.xml says not to use it
anymore, and instead use GetEventVariable.

Be careful when replacing these calls, since some parameters have change.
For example, GetEventVariableList() takes a parameter, where
GetEventAttributeList() does not. Here¹s how this procedure should look:

0xffff0001 P "CreateEventWithVariables( \
>                     {C CURRENT_MODEL}, \
>                     {H 0xffff0002}, \
>                     SetEventVariable( \
>                         GetEventVariableList( { C CURRENT_EVENT } ), \
>                         { H 0x12b4c }, \
>                         Append ( \
>                             Append ( \
>                                 GetEventVariable( {U 1} ), \
>                                 { S \" \" } \
>                             ), \
>                             GetEventVariable( {U 7} ) \
>                         ) \
>                     ) \
>                 )"

The really frustrating thing is that I took what Dave and I had posted,
loaded them both into my SpectroServer, and didn¹t get any errors in my
EventDisp log! It just silently fails like Dave saw.

I hope that this helps everyone, and that I didn¹t waste too much of your
time chasing bugs.

Jim


On 8/6/10 7:41 AM, "David Game" <[email protected]> wrote:

> OK I¹m now a little confused by all this!
>  
> I¹m trying to do the exact same thing and have lifted Jim¹s code but it¹s not
> filling in the title as expected.
>  
> I¹ve tried debugging in various ways and it seems you can only use 1
> GetEventAttribute statement.
>  
> If I use (Where U1 = ³TestDevice² and U7 is set on a test trap to read ³TEST
> ALARM TITLE²)
>  
> GetEventAttributeList(), \
>                        { H 0x12b4c }, \
>                                                 Append ( { S \"DAVE - \" } ,
> GetEventAttribute( {U 7} ) )  \
>                    ) \
>  
> Then I get exactly what I expect - ³DAVE ­ TEST ALARM TITLE²
>  
> But I don¹t want a string with my name, I want the first bit to be the
> hostname (U1)
>  
> So I tried:
>  
> GetEventAttributeList(), \
>                        { H 0x12b4c }, \
>                                                 Append (GetEventAttribute( {U
> 1} ) , GetEventAttribute( {U 7} ) )  \
>                    ) \
>  
> Which I¹d expect to just blindly join the 2 variables together to read
> ³TestDeviceTEST ALARM TITLE². It totally ignores what I want and takes the
> title from the PCAUSE file.
>  
> If I use Jim¹s code below exactly as he¹s typed it but with my variable IDs -
>  
> 0xffff0001 P "CreateEventWithAttributes( \
>                     {C CURRENT_MODEL}, \
>                     {H 0xffff0002}, \
>                     SetEventAttribute( \
>                         GetEventAttributeList(), \
>                         { H 0x12b4c }, \
>                         Append ( \
>                             Append ( \
>                                 GetEventAttribute( {U 1} ), \
>                                 { S \" \" } \
>                             ), \
>                             GetEventAttribute( {U 7} ) \
>                         ) \
>                     ) \
>                 )"
>  
> I¹d expect to see ³TestDevice TESTALARMTITLE² ­ but I don¹t.  Again it just
> uses the PCause file title.
>  
> If I set the attribute to just one GetEventAttributeList() variable with no
> appends, it displays that fine too.  It¹s just not interpreting how I¹m
> appending the variables correctly.
>  
> I¹ve got the same issue on 8.1HF12 and 9.1SP3 so I don¹t think it¹s a version
> issue, more a ³the code doesn¹t work² issue!
> 
> Any ideas where I¹m going wrong ­ or how to make the event procedure come up
> with ³TestDevice ­ TEST ALARM TITLE² in the custom title variable?
>  
> Dave
>  
> 
> From: Pfleger, Jim [mailto:[email protected]]
> Sent: July 23 2010 19:52
> To: spectrum
> Subject: Re: [spectrum] Alarm Title: Concatenation
>  
> We¹re doing this with event procedures. You¹ll need to combine several
> procedures to fill in the alarm title variable 0x12b4c we¹ve been discussing.
> Here¹s a short example where 0xffff0001 is the raw event coming in, and
> 0xffff0002 is the event that you¹ll use to create your alarm.
> 
> 0xffff0001 P "CreateEventWithAttributes( \
>                     {C CURRENT_MODEL}, \
>                     {H 0xffff0002}, \
>                     SetEventAttribute( \
>                         GetEventAttributeList(), \
>                         { H 0x12b4c }, \
>                         Append ( \
>                             Append ( \
>                                 GetEventAttribute( {U 2} ), \
>                                 { S \" \" } \
>                             ), \
>                             GetEventAttribute( {U 3} ) \
>                         ) \
>                     ) \
>                 )"
> 0xffff0002 E 50 A,3,0xffff0002
> 
> This sets the title to a concatenation of var 2 and var 3, with a space in
> between. Event procedures are very arcane, poorly documented, and hard to
> debug, but they¹re the only way to perform event modifications like this.
> 
> HTH,
> Jim
> 
> 
> 
> On 7/23/10 9:55 AM, "Saurabh Bohra" <[email protected]> wrote:
> Hello All,
> 
> Environment: SPECTRUM 9.2 on Windows 2008
> 
> I want to have alarm title based on concatenation of a static text and the
> trap varbind. 
> 
> As an example: A trap with 5th varbind contains a string "ABC is not running"
> or "XYZ is stopped". I want to display the Alarm Title as follows (having
> static text "Process Down:"):
> 
> Process Down: ABC is not running
> or 
> Process Down: XYZ is stopped
> 
> ===================================
> 
> Concatenation of two or more trap varbind.
> 
> As an example: A trap with va22 contains a string "CPU Utilization exceeded"
> and var3 contains the current value say "87" as:
> 
> CPU Utilization exceeded 87
> 
> Thanks in advance.
> Saurabh
> * --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]
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
> 
> This email communication does not create or vary any contractual relationship
> between Logicalis and you. Internet communications are not secure and
> accordingly Logicalis does not accept any legal liability for the contents of
> this message. The contents of this email are confidential to the intended
> recipient at the email address to which it has been addressed. It may not be
> disclosed to or used by anyone other than this addressee, nor may it be copied
> in any way. If received in error, please contact Logicalis on the above
> switchboard number quoting the name of the sender and the addressee and then
> delete it from your system. Please note that neither Logicalis nor the sender
> accepts any responsibility for viruses and it is your responsibility to scan
> the email and attachments (if any).
> Logicalis UK Ltd,  Registered in England and Wales No: 3732397,  Registered
> Office: 110 Buckingham Avenue, Slough. Berkshire, SL1 4PF
> 
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
> *  --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]

Reply via email to