I have the need to take a fairly generic trap and change it into a more 
specific trap with the ability to clear based on a portion of the trap and 
provide a dynamic alarm title as well. (If interested, this is a Cisco CSS 
services alarm). The alarm begins life as follows

$SPECROOT: /SS/CsVendor/Cisco_CSS/CiscoCSS/AlertMap:
# apSvcTransitionTrap                      # apSvcTrapEventText
1.3.6.1.4.1.9.9.368.1.15.1.6.1 0x3cc0008   1.3.6.1.4.1.9.9.368.1.15.10(5,0)

$SPECROOT: /SS/CsVendor/Cisco_CSS/EventDisp
0x3cc0008 E 30

The Event Text looks like this:
  Service Transition - Service:papp42:29730 State:alive
  Service Transition - Service:papp41:29730 State:down
  Service Transition - Service:preg12:389 State:susp

I'd like to create two events, an alarm and a clear using the 
"Service:<server>:port>" as both the discriminator and the dynamic alarm title. 
(I haven't tried the code below since I'm running out of time before 
Thanksgiving). Is this a reasonable way to approach the problem?

# CSS event comes as 0x03cc0008- text in var 5
# Examples of var 5 text:
#   Service Transition - Service:server1:29730 State:alive
#   Service Transition - Service:server1:29730 State:down
#   Service Transition - Service:server1:29730 State:susp
# Create new events based on state down|susp or alive using the service info as 
discriminator
# Use the "Service:<server>":<port>" as the dynamic title and discriminant 
using the magic variable 76620
0x03cc0008 P \
"CreateEventWithVariables( \
        { C CURRENT_MODEL }, \
        { H 0xfff01600 }, \
                SetEventVariable( \
                     GetEventVariableList( { C CURRENT_EVENT } ), \
                                                        { U 76620 }, \
                                                        GetRegexp( \
                                                                { v 5 }, \
                                                                { S 
\"(Service:.*) State:(down|susp)\" } \
                                                                { U 1 } \
                                                        ) \
                                ) \
) " \
P "CreateEventWithVariables( \
        { C CURRENT_MODEL }, \
        { H 0xfff01601 }, \
                SetEventVariable( \
                     GetEventVariableList( { C CURRENT_EVENT } ), \
                                                        { U 76620 }, \
                                                        GetRegexp( \
                                                                { v 5 }, \
                                                                { S 
\"(Service:.*) State:alive\" } \
                                                                { U 1 } \
                                                        ) \
                                ) \
) "

0xfff01600 E 50 A 2,0xfff01600,76620  #Major alarm, discriminant is the 
service:port, also the title
0xfff01601 E 50 C   0xfff01601,76620  #Clear the alarm based on the 
discriminant/title

Thanks,
Al

_________________________
Almon (Al) Sorrell
Global Business Solutions and Technology Services
Corporate Network Services | Network Engineering Consultant

T. Rowe Price
4515 Painters Mill Road, TE9008
Owings Mills, MD 21117
Phone: (410) 345-3042  Cell:(443) 527-2398 Fax:(410) 345-3135
Email: [email protected]





T. Rowe Price (including T. Rowe Price Group, Inc. and its affiliates) and its 
associates do not provide legal or tax advice.  Any tax-related discussion 
contained in this e-mail, including any attachments, is not intended or written 
to be used, and cannot be used, for the purpose of (i) avoiding any tax 
penalties or (ii) promoting, marketing, or recommending to any other party any 
transaction or matter addressed herein.  Please consult your independent legal 
counsel and/or professional tax advisor regarding any legal or tax issues 
raised in this e-mail.

The contents of this e-mail and any attachments are intended solely for the use 
of the named addressee(s) and may contain confidential and/or privileged 
information. Any unauthorized use, copying, disclosure, or distribution of the 
contents of this e-mail is strictly prohibited by the sender and may be 
unlawful. If you are not the intended recipient, please notify the sender 
immediately and delete this e-mail.


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

Reply via email to