Re: Sending traps using Perl

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAO+b5-o+RfmLz=7HrzbfjNja9ePRtWXFtuJL5Bz=FnaXSq099Q@mail.gmail.com>
On Wed, Sep 28, 2011 at 4:36 PM, <[email protected]> wrote:

> However I am still unable to send out an SNMP v2 trap.
>
> Also is there a way of obtaining the value for uptime from the Master Agent
> which is used for the SysUpTime field in the trap??
>

Have you already tried to leave out the "uptime" argument ?

This command allowed me to send an SNMPv2 trap, and at the same time to
observe what happens internally in Net-SNMP while sending a trap:

C:\Perl\bin\perl -e "use SNMP; $SNMP::verbose=1; $SNMP::debugging=2;
$SNMP::dump_packet=1; my $session = new SNMP::TrapSession(Community =>
\"trap\", Port => 162, Version => \"2c\"); $session->trap(oid => \"linkUp\",
[[ifIndex,1,1], [sysLocation,0,\"Here\"]]);"

Bart.

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.