Oid trailing zero

I have got the below OID from the MIB file compiler and i have configured the same in my agent in order to identify and process the snmp trap.
Configured trap OID: 1.3.6.1.4.1.4853.1.2.10.1

Problem is, when agent receives the trap, OID is having extra zero at the end:
Received trap’s OID: 1.3.6.1.4.1.4853.1.2.10.1.0

This causes my agent fail to identify the trap and hence drop the trap.

How do i know whether MIB file compiled had problems or my compiler is having problem to parse and generate the OIDs?

Thanks!

Are you really talking about a notification OID? That should end on *.0.x where x is 1-n.

I would rather guess, that you are talking about an object ID of a scalar object. The OID in the MIB specification must be appended with a instance identifier which is .0 for scalar values.

Thus the MIB compiler is probably correct, but your instrumentation code is not handling the instance sub-identifier correctly. To give you an exact answer, MIB specification and PDU content (i.e. it’s hex-string representation) would be needed.

Sorry for replying lately on this.
Not specifically about notification ID, but rather object ID.
So, do you mean every object identity found from the compiler needs to be appended with “. 0” explicitly in my code?

Sorry i haven’t understood below statement of yours:

To give you an exact answer, MIB specification and PDU content (i.e. it’s hex-string representation) would be needed.

Thanks!

I am pretty sure, that you do not mean OBJECT-IDENTITY but ’OBJECT IDENTIFIER of an OBJECT-TYPE'.
If an .0 instance identifier suffix has to appended depends on the type of OBJECT-TYPE. For a scalar: yes, for a table/tabular object: no.

SNMP4J-Agent always specifies in the JavaDoc contract which kind of OID or OID prefix/suffix needs to be provided. For MOScalar see the constructor:

/**
 * Creates a scalar MO instance with OID, maximum access level and initial
 * value.
 *
 * @param id     the instance OID of the scalar instance (last sub-identifier should be
 *               zero).
 * @param access the maximum access level supported by this instance.
 * @param value  the initial value of the scalar instance. If the initial value is
 *               {@code null} or a Counter syntax, the scalar is created as a
 *               volatile (non-persistent) instance by default.
 */
public MOScalar(OID id, MOAccess access, V value) {
    this.oid = id;
    this.access = access;
    this.value = value;
    this.isVolatile = isVolatileByDefault(value);
}