Release: All Supported Releases
Component: SPCAEM - Events and Alarms
A user had the following requirement;
From a single varbind from a trap, they want to parse out two new varbinds.
The following is a sample from the trap varbind:
Object:1.3.6.1.4.1.9.9.368.1.15.10.0 Value:Service Transition - Service:bridge-http State:down
What they would like to do is parse out the Service and the State into two new separate varbinds.
Using the above sample trap varbind, the Service varbind would be "bridge-http" and the State varbind would be "down".
The following Event Procedure will parse out the required information:
0xffff0000 E 50 P " \
CreateEventWithAttributes( \
{ C CURRENT_MODEL }, \
{ H 0xffff0001 }, \
SetEventAttribute( \
SetEventAttribute( \
GetEventAttributeList(), \
{ U 2 }, \
GetRegexp( \
GetEventAttribute( { U 1 } ), \
{ S \"Service: *(.*?) +\" }, \
{ U 1 } )), \
{ U 3 }, \
GetRegexp( \
GetEventAttribute( { U 1 } ), \
{ S \"State: *(.*)\" }, \
{ U 1 } )))"