After shutdown agent, I could see the .cfg file.
Is there any debug method to find which security protocol is not working properly?
I use Eclipse ‘Debug Configurations -> Remote Java Application’ to make a debug running.
Result is different from previous: agent was not hanged at ‘SHA-256localized key’ but went on and hanged at below prints:
28876 [main] INFO org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl - Sent notification with ID 1 TRAP[{contextEngineID=80:00:13:70:01:7f:00:00:01:50:88:65:b4, contextName=}, requestID=1630291867, errorStatus=0, errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = 0:00:25.75; 1.3.6.1.6.3.1.1.4.1.0 = 1.3.6.1.6.3.1.1.5.1]] to UserTarget[address=127.0.0.1/162,version=3,timeout=2500,retries=1,securityLevel=3,securityModel=3,securityName=SHA256DES,preferredTransports=null, authoritativeEngineID=80:00:13:70:01:7f:00:00:01:50:88:65:b4]
28876 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - VACM access requested for context=, securityName=TLSPRIV, securityModel=4, securityLevel=3, viewType=0, OID=1.3.6.1.6.3.1.1.5.1
28876 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Found group name 'v3group' for secName 'TLSPRIV' and secModel 4
28876 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Got views [DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.1,values=[1, unrestrictedReadView, , unrestrictedNotifyView, 3, 1], DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.2,values=[1, unrestrictedReadView, unrestrictedWriteView, unrestrictedNotifyView, 3, 1], DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.3,values=[1, unrestrictedReadView, unrestrictedWriteView, unrestrictedNotifyView, 3, 1], DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.4.1,values=[1, unrestrictedReadView, , unrestrictedNotifyView, 3, 1]] for group name 'v3group'
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Matching against access entry DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.1,values=[1, unrestrictedReadView, , unrestrictedNotifyView, 3, 1] with exactContextMatch=true, prefixMatch=false, matchSecModel=false and matchSecLevel=true
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Matching against access entry DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.2,values=[1, unrestrictedReadView, unrestrictedWriteView, unrestrictedNotifyView, 3, 1] with exactContextMatch=true, prefixMatch=false, matchSecModel=false and matchSecLevel=true
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Matching against access entry DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.3.3,values=[1, unrestrictedReadView, unrestrictedWriteView, unrestrictedNotifyView, 3, 1] with exactContextMatch=true, prefixMatch=false, matchSecModel=false and matchSecLevel=true
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Matching against access entry DefaultMOMutableRow2PC[index=7.118.51.103.114.111.117.112.0.4.1,values=[1, unrestrictedReadView, , unrestrictedNotifyView, 3, 1] with exactContextMatch=true, prefixMatch=false, matchSecModel=true and matchSecLevel=true
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Matching view found for group name 'v3group' is 'unrestrictedNotifyView'
28877 [main] DEBUG org.snmp4j.agent.mo.snmp.VacmMIB - Access allowed for view 'unrestrictedNotifyView' by subtree 1.3.6 for OID 1.3.6.1.6.3.1.1.5.1
28881 [main] DEBUG org.snmp4j.mp.MPv3 - Adding cache entry: StateReference[msgID=68829,pduHandle=PduHandle[1630291868],securityEngineID=80:00:13:70:01:7f:00:00:01:50:88:65:b4,securityModel=org.snmp4j.security.TSM@3e74829,securityName=TLSPRIV,securityLevel=1,contextEngineID=80:00:13:70:01:7f:00:00:01:50:88:65:b4,contextName=,retryMsgIDs=null]
28881 [main] DEBUG org.snmp4j.transport.TLSTM - Looking up connection for destination '127.0.0.1/1162' returned: null
28881 [main] DEBUG org.snmp4j.transport.TLSTM - {}
28881 [main] DEBUG org.snmp4j.transport.TLSTM - Socket for address '127.0.0.1/1162' is closed, opening it...
Exception in thread "main" java.lang.NullPointerException
at java.io.FileInputStream.<init>(FileInputStream.java:130)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at org.snmp4j.transport.TLSTM$DefaultSSLEngineConfiguration.getSSLContext(TLSTM.java:1814)
at org.snmp4j.transport.TLSTM$SocketEntry.<init>(TLSTM.java:663)
at org.snmp4j.transport.TLSTM$ServerThread.sendMessage(TLSTM.java:1201)
at org.snmp4j.transport.TLSTM.sendMessage(TLSTM.java:477)
at org.snmp4j.transport.TLSTM.sendMessage(TLSTM.java:69)
at org.snmp4j.MessageDispatcherImpl.sendMessage(MessageDispatcherImpl.java:203)
at org.snmp4j.MessageDispatcherImpl.sendPdu(MessageDispatcherImpl.java:522)
at org.snmp4j.Snmp.sendMessage(Snmp.java:1087)
at org.snmp4j.Snmp.send(Snmp.java:968)
at org.snmp4j.Snmp.send(Snmp.java:961)
at org.snmp4j.Snmp.send(Snmp.java:926)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.sendNotification(NotificationOriginatorImpl.java:270)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:376)
at org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl.notify(NotificationOriginatorImpl.java:140)
at org.snmp4j.agent.AgentConfigManager.fireLaunchNotifications(AgentConfigManager.java:400)
at org.snmp4j.agent.AgentConfigManager.launch(AgentConfigManager.java:392)
at org.snmp4j.agent.AgentConfigManager.run(AgentConfigManager.java:248)
at com.nokia.snmpapp.SnmpAgent.run(SnmpAgent.java:269)
at com.nokia.snmpapp.SnmpApp.main(SnmpApp.java:38)
What’s strange is, the address in TLSTM was changed to ‘127.0.0.1/1162’, while it’s ‘127.0.0.1/162’ in NotificationOriginatorImpl UserTarget.
Why is the port changed from 162 to 1162?