engineTime and engineBoots synchronization issue

Greetings,

Im quite new to snmp, and not sure if I fully understand the way I should use snmp4j library because of that, so I apologize in advance if the questions will be off, but I went through the forum and it seems like the issue is either much simpler, or much more complicated on my side…

So currently, the main issue that I experience is bad engineTime and engineBoots. If I understand correctly, I must

  1. discover the engine id
snmp.discoverAuthoritativeEngineID(GenericAddress.parse(SNMP_TARGET), 5000)
  1. Make a normal snmp get request, and upon failure, I should receive the REPORT, with engineTime and engineBoots in it, which I will be able to use/further calculate afterwards

step 1 seems to be working just fine, but I never receive any Report message in step 2. I do get some kind of message if I use transportMapping’s transportListener (however, it’s byteBuffer so I havent yet figured out the way to properly decode it and see what’s inside).
I can see messages on the agent side dump, that contain time and boots, but nothing on the client (snmp4j app) side that I’ll be able to use.

09:58:12.606437 IP (tos 0x0, ttl 64, id 48514, offset 0, flags [DF], proto UDP (17), length 162)
    xx.xx.xx.xx.snmp > yy.yy.yy.yy.snmp: [bad udp cksum 0xdf4c -> 0xaa0a!]  { SNMPv3 { F=a } { USM B=10 T=77335 U="snmpuser" } { ScopedPDU E=_80_00_1f_00_80_88_fa_00_00_80_5b_c0_67_00_00_00_00 C="" { Report(28) R=0  S:snmpUsmMIB.usmMIBObjects.usmStats.usmStatsNotInTimeWindows.0=6 } } }

So I was wondering, if snmp4j is rejecting the report for any particular reason, and there are some extra steps that Im missing.

I really appreciate any assistance with this,
Thank you!

Step 1 from your list is triggering the REPORT PDU already and uses it to locally store engine ID and boots counter for the specified target.

Step 2 is redundant and will not work after step 1 has completed.

Hello again,

Thank you for the response!
I think I’m missing something here, because the report that I receive on discoverAuthoritativeEngineID() call doesn’t seem to contain engineTime and boots, that’s why I actually tried approach described in step 2 with manual time/boots retrieval, which didn’t work…

What I do now is

  • set auth protocols
  • define transport mapping
  • add transportMapping to snmp instance
  • setContextEngineIdDiscoveryDisabled to false
  • call listen() on snmp and transportMapping
  • Create instance of USM, add message processing model with usm to snmp instance
  • setEngineDiscoveryEnabled to true
  • call discoverAuthoritativeEngineID()

the engineId is discovered just fine, but any actual oid reads fail.
Are engineId and boots supposed to be stored internally, without any need to actually process them?

Thank you