Hey guys, I was hunting forum posts to see if something similar was ever asked and did not find it already... I am working to reproduce an issue in my monitoring system and to do so, it would greatly help if I could use snmptrap to send an identical trap as the device I'm troubleshooting. I wanted to ask and see if there was already an easy to follow guide that explains how to read the capture from wireshark and formulate a snmptrap command to mimic the trap. I am rather green with wireshark and snmptrap so any advice is appreciative. asked 10 Jun '14, 14:39 BenB |
One Answer:
it would work for SNMP v1 and v2 traps, however not for v3 traps (due to the authentication). So, here is how I would do it. I can't write the whole script for you, as that's quite some work... First 'print' the content of SNMP trap frames with tshark and pipe the output into your script (you'll have to write that!).
Result of tshark:
Second: Within your script, look for the SNMP 'parameters' to form the snmptrap command, which are (just some examples)
Unfortunately SNMPv1 traps look differently than SNMPv2 traps and the same holds true for the snmptrap commands (see the man page). Furthermore there are several value types (int32, etc.) which you'll have to translate to snmptrap parameters. Result: Yes, it's possible to create a snmptrap command based on the capture file, but the script that parses the tshark output has to do 'some work' to make it happen. Regards answered 12 Jun '14, 06:44 Kurt Knochner ♦ |
Thanks Kurt! This was extremely helpful, I'll get to writing the script, and then post my results.