SPECTRUM Event Procedure for parsing out two varbinds from a single varbind entry (Legacy KB ID CNC TS31202 )

Document ID : KB000052011
Last Modified Date : 14/02/2018
Show Technical Document Details
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 } )))"


 



Related Issues/Questions:
SPECTRUM Event Procedure for parsing out two varbinds from a single varbind entry

Problem Environment:
SPECTRUM 08.01.00.00
SPECTRUM 09.00.00.00
Event Procedure
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:bridge202-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 "bridge202-http" and the State varbind would be "down".



Additional Information:
Note: The above Event Procedure assumes varbind 1 is the input varbind and varbinds 2 and 3 are the output varbinds. You may need to change these to your specific needs.
Note: The Event ID's may need to be changed to your specific needs.
Note: Please refer to the SPECTRUM 9.0 Event Configuration User Guide for more information on Event Procedures


(Legacy KB ID CNC TS31202 )