use SNMP_util "0.54"; # This will load the BER and SNMP_Session for us snmptrap("public\@172.20.50.13:162", ".1.3.6.1.4.1.2789", "sunserver1", 6, 1247,".1.3.6.1.4.1.2789.1247.1", "int", "2448816"); #### my $trap_session = SNMPv1_Session->open_trap_session () or die "cannot open trap session"; my ($trap, $sender_addr, $sender_port) = $trap_session->receive_trap () or die "cannot receive trap"; my ($community, $enterprise, $agent, $generic, $specific, $sysUptime, $bindings) = $session->decode_trap_request ($trap) or die "cannot decode trap received" ... my ($binding, $oid, $value); while ($bindings ne '') { ($binding,$bindings) = &decode_sequence ($bindings); ($oid, $value) = decode_by_template ($binding, "%O%@"); print BER::pretty_oid ($oid)," => ",pretty_print ($value),"\n"; }