Bart,

I'm definitely getting closer now. I can now send a linkUp trap from my 
software using SNMPv2. My code looks like this:

    my $host = '10.50.80.197';
    my $session= new SNMP::TrapSession(DestHost => $host, Community => 
"public", Port => 162, Version => '2c');
    $session->trap(oid => "linkUp", [["ifIndex",1,1], 
["sysLocation",0,"Here"]]);

Why do you include  the sysLocation.0 mib item when sending the LinkUp 
trap?

As you can see I have omitted the uptime field in the call to the trap 
function. 

This results in the following output from snmptrapd:

Received 106 byte packet from UDP: [10.50.80.197]:1366->[0.0.0.0]:0
0000: 30 68 02 01  01 04 06 70  75 62 6C 69  63 A7 5B 02 0h.....public§[.
0016: 02 1D 73 02  01 00 02 01  00 30 4F 30  11 06 08 2B ..s......0O0...+
0032: 06 01 02 01  01 03 00 43  05 00 C9 BF  87 23 30 17    .......C..É¿╬
#0.
0048: 06 0A 2B 06  01 06 03 01  01 04 01 00  06 09 2B 06    ..+..........  
    +.
0064: 01 06 03 01  01 05 04 30  0F 06 0A 2B  06 01 02 01 .......0...+....
0080: 02 02 01 01  01 02 01 01  30 10 06 08  2B 06 01 02 ........0...+...
0096: 01 01 06 00  04 04 48 65  72 65                       ......Here

2011-09-28 17:01:24 LWPC211.uksecure.uk.mobile.marconi.com [UDP: 
[10.50.80.197]:1366->[0.0.0.0]:0]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (3384772387) 391 days, 
18:08:43.87     SNMPv2-MIB::snmpTrapOID.0 = OID:
 IF-MIB::linkUp IF-MIB::ifIndex.1 = INTEGER: 1  SNMPv2-MIB::sysLocation.0 
= STRING: Here

The timeticks value does not seem to be a sensible value unfortunately as 
I have certainly not been running my agent for 391 days!

I have changed my code to try and send my user defined trap as follows but 
without any success so far i.e. no trap is received by snmptrapd:

    my $host = '10.50.80.197';
    my $session= new SNMP::TrapSession(DestHost => $host, Community => 
"public", Port => 162, Version => '2c');
  $session->trap(oid => "ssaSwitchStopped");

The ssaSwitchStopped trap has no additional varbinds associated with it.

Regards,

Ali



Please consider the environment before printing this email



-----------------------------------------------
This email and any attached files contains company confidential information 
which may be legally privileged.  it is intended only for the person(s) or 
entity to which it is addressed and solely for the purposes set forth therein.  
If you are not the intended recipient or have received this email in error 
please notify the sender by return, delete it from your system and destroy any 
local copies.  It is strictly forbidden to use the information in this email 
including any attachment or part thereof including copying, disclosing, 
distributing, amending or using for any other purpose.

In addition the sender excludes all liabilities (whether tortious or common 
law) for damage or breach arising or related to this email including but not 
limited to viruses and libel.

<<image/gif>>

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