I am trying to send an SNMPv2 trap from my SubAgent which can communicate with an SNMP Manager via the Agent X master agent. I am running version 5.7.1 pre2 on Windows and trying to send traps to the snmptrapd daemon.
My code for sending the trap is as follows:
my $host = '127.0.0.1';
my $comm = 'public';
my $session = new SNMP::TrapSession(HostName => $host, Community =>
$comm, Port => 162, Version => 1);
$session->trap(oid => '1.3.6.1.4.1.2257.11.1.1.0.0.9',
uptime => 1234);
The trap that I am sending is an enterprise specific trap and is defined
as follows:
ssaSwitchStopped NOTIFICATION-TYPE
STATUS current
DESCRIPTION
"The Sentinel Switch is no-longer running"
::= { ssaEvents 9 }
I am running snmptrapd as follows:
snmptrapd -f -Le -d
The output is as follows:
Received 42 byte packet from UDP: [127.0.0.1]:4151->[0.0.0.0]:0
0000: 30 28 02 01 00 04 06 70 75 62 6C 69 63 A4 1B 06 0(.....public¤..
0016: 07 2B 06 01 04 01 8F 65 40 04 0A 32 50 C5 02 01 [email protected]Å..
0032: 06 02 01 00 43 02 04 D2 30 00 ....C..Ò0.
2011-09-28 10:37:31 LWPC211.uksecure.uk.mobile.marconi.com [10.50.80.197]
(via UDP: [127.0.0.1]:4151->[0.0.0.0]:0) TRAP,
SNMP v1, community public
UCD-SNMP-MIB::ucdavis Enterprise Specific Trap (0) Uptime:
0:00:12.34
Does anyone know why its displaying the trap as UCD-SNMP-MIB::ucdavis
Enterprise Specific Trap (0) and not as my specific trap?
Also if I change the Version variable from 1 to 2 in my SNMP::TrapSession
no trap seems to be getting sent.
Any help would be appreciated.
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 [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users
