Sending a v1 trap with type=inform instead of type=0 fixed it from rewriting 0 to a 6 (actually further trying showed I could put anything other than type=specific for that field to get the results to match what was originally logged).
Anyone explain why it changes type=0 to type=6 since that is what the trap daemon logs to the logfile? Thanks Greg > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of King, John (Greg) (LMIT-HOU) > Sent: Tuesday, May 24, 2005 7:51 PM > To: net-snmp-users@lists.sourceforge.net > Subject: RE: Perl snmp_trap examples?partial success > > Ah thanks! After that I noticed that a few pieces were not > formatted properly in my session object, once I fixed those it worked. > > Only one problem is that I am trying to forward an exact copy > based on data from the trap.log file TRAP date=5-24-2005 > time=19:38:2 version=TRAP, SNMP v1, community xxxxxxx > host=x.x.x.x enterprise=iso.3.6.1.4.1.311.1.1.3.1.1 type=0 > subtype=0 desc=Cold Start varbinds= > > When I send it with the example code below I get this in the log > > TRAP date=5-24-2005 time=19:48:57 version=TRAP, SNMP v1, > community xxxxx > host=127.0.0.1 enterprise=iso.3.6.1.4.1.311.1.1.3.1.1 type=6 > subtype=.0 desc=Enterprise Specific varbinds= > > Why are the type and subtype changing? > > > > In case anyone needs to search for an example in the future > heres the example > > #!/usr/bin/perl > > use SNMP; > > my $desthost = 'x.x.x.x'; > my $comm = 'xxxxxxx'; > > my $sess = new SNMP::Session ( DestHost => $desthost, > Community => $comm, RemotePort => 162, Version => 1 ); > @results = $sess->trap( > enterprise=>'.1.3.6.1.4.1.311.1.1.3.1.1', > agent => '127.0.0.1', > generic => 0, > specific => 0, > uptime => 1234); > > print "Debug:" . @results . "\n"; > ------------------------------------------------------- SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate online with coworkers and clients while avoiding the high cost of travel and communications. There is no equipment to buy and you can meet as often as you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users