If I issue the command below I get a log entry in trap.log
snmptrap -v2c -c public 127.0.0.1 '' .1.3.6.1.4.1.311.1.1.3.1.1 

If I try this in perl nothing occurs but I get a result return of 1.

#!/usr/bin/perl
use SNMP;
my $desthost = '127.0.0.1';
my $comm     = 'public';
my $sess = new SNMP::Session ( DestHost => $desthost, Community => $comm,
RemotePort => 162, Version => 2 );
@results = $sess->trap(
                oid     => '.1.3.6.1.4.1.311.1.1.3.1.1',
                uptime  => 1234,
                []);
print "Done:" . @results . "\n";

I also tried it with Version => 2c, Version=> '2', and Version=> '2c' with
the same results.

Than podfile says this should work:

trap(oid, uptime, <vars>) - v2 format
            $sess->trap(oid => 'snmpRisingAlarm',
                        uptime => 1234,
                        [[ifIndex, 1, 1],[sysLocation, 0, "here"]]); #
optional vars
                                                                     #
always last


-------------------------------------------------------
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

Reply via email to