On 1 April 2011 00:54, akshata s harkantra <[email protected]> wrote:
> After I identified the notifcation object, the following is working
>
> snmptrap -v 1 ....
> But the same thing when I try using v2/v3 version ,It gives the following
> error [Changing -v to 2c or 3]
As Erik has indicated - the structure of SNMPv2/3 is *not* the same as
that of SNMPv1. The parameters to the "snmptrap" command are very
different for the two versions.
See the man page for details.
But there's another problem with both the command you are using,
and the amended version that Erik suggests:
> snmptrap -v 1 -c public -M "my mibs path" "address"
> SNMPv2-MIB::snmpTrapOID localhost 5 1 '' SNMPv2-MIB::sysName.0 s "test"
> snmptrap -v 2c -c public -M "my mibs path" "address" ''
> SNMPv2-MIB::snmpTrapOID SNMPv2-MIB::sysName.0 s "test"
In both cases, the OID that used to identify the notification is
SNMPv2-MIB::snmpTrapOID
This is *not* the OID of a NOTIFICATION-TYPE object.
The structure of an SNMPv2 notification is a simple series of varbinds,
with the first two being
SNMPv2-MIB::sysUpTime.0 = xxxx
SNMPv2-MIB::snmpTrapOID.0 = YYYY
You need to specify the 'YYYY' value on the command line
(in place of the 'SNMPv2-MIB::snmpTrapOID' field in the commands above).
This *MUST* be the OID of a MIB object defined using NOTIFICATION-TYPE
The fact that the Net-SNMP tools are lax about checking this
doesn't affect the fact that specifying a trap using
SNMPv2-MIB::snmpTrapOID.0 = SNMPv2-MIB::snmpTrapOID
is Just Plain Wrong!
Dave
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders