...
This is a critical concept. The node property will always be the same for any given node. The element property will be somewhat dynamic, usually a regular expression will parse it. The most comment element example would be an interface; gig0/0 versus gig0/1. The stateful property is necessary because the same element may have different events; consider an interface down event versus an OSPF event on the same element (gig0/0).
Example parser for the element property.
Code Block |
---|
53 => {
IF => qr/IF-MIB::ifIndex\.\d+=(\d+)/,
THEN => ["capture(element)"],
}, |
Example parser for the stateful property
Code Block |
---|
51 => {
IF => qr/IF-MIB::linkDown/,
THEN => ["set.event(Interface Down)", "set.stateful(Interface)",
"set.state(down)", "set.priority(3)" ],
}, |
Create Parser Rules
opEvents will process the trap log file as specified on opCommon.nmis. When parsing the traps the following properties should be extracted.
...