It's definitely a string - it's the hostname of the faulty device.
I just put your code below in and got "TestDeviceTEST ALARM TITLE" so what's below works! I just need to add a 3rd "Append" to put " - " between the variables and we should be golden! Thanks for your assistance, it's greatly appreciated. Dave From: Pfleger, Jim [mailto:[email protected]] Sent: August 06 2010 17:44 To: spectrum Subject: Re: [spectrum] Alarm Title: Concatenation Without seeing what's in the original trap, but just based on what's working for you and what isn't, I'm going to guess that what's in variable 1 isn't a string, or at least Spectrum doesn't think it's a string. We've had to do some funny business using Append() to cast values as strings. Try this with your data and see if it works any better: 0xfff000b0 P "CreateEventWithVariables( \ {C CURRENT_MODEL}, \ {H 0xffff00b0}, \ SetEventVariable( \ GetEventVariableList( { C CURRENT_EVENT } ), \ { H 0x12b4c }, \ Append ( \ Append ( \ { S \"\" }, \ GetEventVariable( {U 1} ) \ ), \ GetEventVariable( {U 7} ) \ ) \ ) \ )" By prepending nothing, we're effectively casting variable 1 as a string. We've had to do this to get GetRegexp() to look at some of our variables, so I can imagine Append() having a similar problem. Also, what happens if you use just variable 1 in the Set call (in your second example), instead of variable 7? Have you turned on the event_disp_error_file and procedure_error_file logs in the .vnmrc? Is there anything in them? HTH, Jim On 8/6/10 9:11 AM, "David Game" <[email protected]> wrote: That's still not working Jim. Here's the code that I have 0xfff000b0 P "CreateEventWithVariables( \ {C CURRENT_MODEL}, \ {H 0xffff00b0}, \ SetEventVariable( \ GetEventVariableList( { C CURRENT_EVENT } ), \ { H 0x12b4c }, \ Append ( \ Append ( \ GetEventVariable( {U 1} ), \ { S \" \" } \ ), \ GetEventVariable( {U 7} ) \ ) \ ) \ )" The only different is the event codes we're using. Yet it's still only giving me the PCAUSE title. If I remove the append stuff and just use: 0xfff000b0 P "CreateEventWithVariables( \ {C CURRENT_MODEL}, \ {H 0xffff00b0}, \ SetEventVariable( \ GetEventVariableList( { C CURRENT_EVENT } ), \ { H 0x12b4c }, \ GetEventVariable( {U 7} ) \ ) \ )" It puts Variable 7 in just fine. The append just doesn't seem to work. So I thought I'd be clever and tried Append ( GetEventVariable( {U 1} ), GetEventVariable( {U 7} )) Just to (again) join 2 variables with no space in between and it still gives me the PCAUSE title. It's infuriating! BTW I've only spent 2 days chasing bugs on this, so not too bad J Dave From: Pfleger, Jim [mailto:[email protected]] Sent: August 06 2010 16:38 To: spectrum Subject: Re: [spectrum] Alarm Title: Concatenation 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] ______________________________________________________________________ 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] ______________________________________________________________________ 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]
