Thanks Dave for your suggestion. After I identified the notifcation object, the following is working
snmptrap -v 1 -c public -M "my mibs path" "address" SNMPv2-MIB::snmpTrapOID localhost 5 1 '' SNMPv2-MIB::sysName.0 s "test" For the above command I see the string "test" getting received on the receiver side But the same thing when I try using v2/v3 version ,It gives the following error [Changing -v to 2c or 3] localhost: Unknown Object Identifier (Sub-id not found: (top) -> localhost) Command for v2 used snmptrap -v 2 -c public -M "my mibs path" "address" SNMPv2-MIB::snmpTrapOID localhost 5 1 '' SNMPv2-MIB::sysName.0 s "test" Command for v3 snmptrap -e 0xc0a80102c0a80102 -v 3 -u snmpuser -a MD5 -A passwd1 -x DES -X passwd2 -l authPriv -M "mibs path" "ipaddress" SNMPv2-MIB::snmpTrapOID localhost:162 7 1 '' SNMPv2-MIB::sysName.0 s "Sending a test trap" Regards, Akshata On Thu, Mar 31, 2011 at 12:37 AM, Dave Shield <[email protected]>wrote: > On 31 March 2011 07:48, akshata s harkantra <[email protected]> > wrote: > > I need to send a message or string using snmptrap command to the receiver > end. > > snmptrap -v 2c -c public "ipaddress" sysDescr.0 > > No. > > The OID that you send with snmptrap must be the OID of a *notification* > object. > (i.e. one defined using NOTIFICATION-TYPE) > Something like SNMPv2-MIB::coldStart or IF-MIB::linkUp > > You can't send an arbitrary OID as the OID of the trap. > > > You can *add* varbinds to the payload of the trap (starting with the list > of > objects defined in the MIB file, and adding any arbitrary varbinds after > this > list). But you do need to identify the notification first. > > See any book on SNMP for more details. > > > 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
