
SnmpXmlParser
agent, community, enterprise, generic, specific, ticks, duration
All attributes are defined by SNMP, except the "duration" attribute, which is added as a convenience. The duration represents the "ticks" attribute (hundredths of seconds since some element-specific reset) converted into a human-readable time duration, in the format:
[days] [hours]:[minutes]:[seconds].[hundredths]
Below is an example trap, in the expected XML format. A blank line is appended after each trap for easier human viewing. (The first line is split here to avoid scrolling; the line is not split in live events.)
<trap:v1 agent="192.12.12.12" community="public" enterprise="1.3.6.1.1"
generic="2" specific="4" ticks="11100" duration="129 1:06:51.88">
<varbind name="1.3.6.1.1.0" value="one thing" type="SNMPOctetString"/>
<varbind name="1.3.6.1.1.1" value="987" type="SNMPInteger"/>
</trap:v1>
This handler would parse the above XML into the following values:
| agent | 192.12.12.12 |
|---|---|
| community | public |
| enterprise | 1.3.6.1.1 |
| generic | 2 |
| specific | 4 |
| ticks | 11100 |
| duration | 129 1:06:51.88 |
| var1 | one thing |
| var2 | 987 |