Thatīs exactly Iīm trying to do, but I donīt know how to send the extracted payload from the packets that I get from the object Net::Frame::Simple and use it as input to the buffer in the Mon::SNMP module

From my code I have in $f the extracted package

print $f->print."\n";

how can I just "isolate" this part

o Frame number: 41 (length: 401) ETH: dst:d8:d3:85:de:85:68 src:78:e7:d1:56:f7:a0 type:0x0800 IPv4: version:4 hlen:5 tos:0x00 length:387 id:0 IPv4: flags:0x02 offset:0 ttl:64 protocol:0x11 checksum:0xd8ee IPv4: src:172.19.4.58 dst:172.19.4.27 UDP: src:41665 dst:162 length:367 checksum:0x9443
UDP: payload:3082016302010104066573796d6163a782015402041560ae2702010002010030820144301006082b0601020101030043040cd6aeed3019060a2b060106030101040100060b2b060104015e07010300023028060c2b060104015e07010402010204184950444f4d2d312f49504e452d392f49504e4549462d31363012060c2b060104015e0701040201010202062f3018060c2b060104015e070104020103040807da090d0f2a20013013060c2b060104015e070104020104020301e271302c060c2b060104015e070104020105041c504f5254204f5220494e5445524641434520484153204641494c45443011060c2b060104015e070104020106020105302c060c2b060104015e070104020107041c506f7274206f7220696e7465726661636520686173206661696c65643012060c2b060104015e0701040201080202013b3011060c2b060104015e0701040201090201043012060c2b060104015e07010402010a02020b51

and use it as the value in the $snmptrap

$trap->buffer($snmptrap);

My apologies if this looks easy, but Iīm still trying to understand how use this modules on my project.


In reply to Re^2: How to parse SNMP traps from pcap file by dalbaranster
in thread How to parse SNMP traps from pcap file by dalbaranster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.