[SNMP4J] Sending an object identifier
Frank Fock
fock at agentpp.com
Tue Jun 29 19:12:02 CEST 2010
Hi,
Object identifiers are specified in dotted notation:
each sub-identifier separated by a dot ('.').
For example: 1.3.6.1.4.1
Best regards,
Frank
On 29.06.2010 12:39, Gian Marco Gallo wrote:
> Good day
>
> I'm trying to send a notification with snmp4j and to add informations in
> my pdu (so the mib in the server can print the right message in the
> server log). So I've tried this:
>
>
> pdu = new PDU();
> pdu.setType(PDU.TRAP);
> pdu.add(new VariableBinding(SnmpConstants.snmpTrapOID, new
> OctetString("UCD-NOTIFICATION-TEST-MIB::demoNotif")));
>
> But in the server log appears this:
>
> Jun 29 12:30:14 qa1 snmptrapd[6166]: 2010-06-29 12:30:14 luna.elaide.com
> [UDP: [192.168.5.19]:48917]: SNMPv2-MIB::snmpTrapOID.0 = Wrong Type
> (should be OBJECT IDENTIFIER): STRING:
> "UCD-NOTIFICATION-TEST-MIB::demoNotif"
>
> Any idea on how send an object identifier?
> This is the mib on the server:
>
> UCD-NOTIFICATION-TEST-MIB DEFINITIONS ::= BEGIN
> IMPORTS ucdExperimental FROM UCD-SNMP-MIB;
>
> ucdNotificationTestMib MODULE-IDENTITY
>
>
> demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }
> demonotifs OBJECT IDENTIFIER ::= { demotraps 0 }
>
> *demoNotif* NOTIFICATION-TYPE
> OBJECTS { sysLocation }
> STATUS current
> DESCRIPTION "An example of an SMIv2 notification"
> *::= { demonotifs 18 }*
>
> ucdNotificationGroup NOTIFICATION-GROUP
>
> END
>
> Thanks in advance
>
>
--
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the SNMP4J
mailing list