...
Code Block |
---|
### This is observed the trap opEvents is receiving, and ### is the best candidate to become the element property: STARENT-MIB::starSlotNum=6 ### Refering to the vendors mib file starSlotNum is found: starSlotNum OBJECT-TYPE SYNTAX Integer32(1..48) MAX-ACCESS accessible-for-notify STATUS current DESCRIPTION "The slot number" ::= { starSlotEntry 1 } |
Based on this we can write the regular expression to set the element.
Code Block |
---|
2 => {
DESCRIPTION => 'Set element for card number.',
IF => qr/(STARENT-MIB::starSlotNum=\d+)/,
THEN => ["capture(element)"],
}, |
Notice the regular expression will catch an number of digits following the '=' character. This rule 'captures' the element. In this way we can dynamically assign event properties based on a regular expression.