Giter VIP home page Giter VIP logo

Comments (23)

ceharris avatar ceharris commented on June 12, 2024 1

BTW, I opened issue #10 to improve the OID-to-name resolution so that the order in which MIBs are loaded is less critical.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024 1

Fantastic! Glad to help. I'm going to go ahead and implement the improve described in issue #10 and then I'll make a new release that incorporates the fixes that were put in for this issue and improvement #10. I'll update this issue when the new release has been pushed.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024 1

Version 1.0.9 has been released. Should be available via Maven Central within the next few hours.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

Could you please share your listener code? You could either create a Gist that contains it and just put the link to it here, or (it it's not too big) paste it in to this thread.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

Thanks for fast reply. The listener code looks like this:

listener = SnmpFactory.getInstance().newListener(listenAddress, portNumber, mib);
		listener.addHandler(new SnmpNotificationHandler() {
			@Override
			public Boolean handleNotification(SnmpNotificationEvent event) {
				if (logger.isDebugEnabled()) {
					logger.debug("Event: " + event);
				}
				saveTrap(event);
				return true;
			}
		});

And these are the MIBs we load

		Mib mib = MibFactory.getInstance().newMib();
			mib.load("SNMPv2-SMI");
			mib.load("SNMPv2-TC");
			mib.load("SNMPv2-CONF");
			mib.load("SNMP-FRAMEWORK-MIB");
			mib.load("SNMP-TARGET-MIB");
			mib.load("SNMP-NOTIFICATION-MIB");
			mib.load("IANA-ITU-ALARM-TC-MIB");
			mib.load("ITU-ALARM-TC-MIB");
			mib.load("INET-ADDRESS-MIB");
			mib.load("RFC1155-SMI");
			mib.load("RFC1158-MIB");
			mib.load("RFC-1212");
			mib.load("RFC1213-MIB");
			mib.load("RMON-MIB");
			mib.load("RFC1271-MIB");
			mib.load("TOKEN-RING-RMON-MIB");
			mib.load("RMON2-MIB");
			mib.load("ALARM-MIB");
			mib.load("ERICSSON-TOP-MIB");
			mib.load("ERICSSON-TC-MIB");
			mib.load("ERICSSON-ALARM-TC-MIB");
			mib.load("ERICSSON-ALARM-PC-MIB");
			mib.load("ERICSSON-ALARM-MIB");

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

Can you provide the output of the logger.debug call?

Is the exception is being thrown in the saveTrap method? Can you share the source of that method?
Could you add the stack trace to this issue as a comment, too?

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

I think the issue is that you're trying to use what is returned in the trap as though it is a table row, when it fact, it is just a reference to a table row. Need to see the saveTrap source...

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

Heres the log:

2019-03-20 08:24:08,972 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 MibbleIndexExtractor.java:66] - 1.3.6.1.4.1.193.183.4.1.3.5.1.5
2019-03-20 08:24:08,973 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 MibbleIndexExtractor.java:68] - 1.3.6.1.4.1.193.183.4.1.3.5.1.5
2019-03-20 08:24:08,973 WARN [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:139] - listener exception: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source) ~[?:1.8.0_201]
at org.soulwing.snmp.provider.mibble.MibbleIndexExtractor.extractIndexes(MibbleIndexExtractor.java:69) ~[2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.soulwing.snmp.provider.snmp4j.Snmp4jVarbind.getIndexes(Snmp4jVarbind.java:159) ~[2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.soulwing.snmp.provider.snmp4j.SimpleVarbindFactory.newVarbindCollection(SimpleVarbindFactory.java:65) ~[2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.soulwing.snmp.provider.snmp4j.Snmp4jNotificationEventFactory.newNotification(Snmp4jNotificationEventFactory.java:58) ~[2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.soulwing.snmp.provider.snmp4j.Snmp4jNotificationEventFactory.newEvent(Snmp4jNotificationEventFactory.java:53) ~[2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.soulwing.snmp.provider.snmp4j.Snmp4jListener.processPdu(Snmp4jListener.java:136) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.Snmp$NotificationDispatcher.processPdu(Snmp.java:1934) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.Snmp.fireProcessPdu(Snmp.java:1444) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.Snmp.processPdu(Snmp.java:1215) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.MessageDispatcherImpl.fireProcessPdu(MessageDispatcherImpl.java:675) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.MessageDispatcherImpl.dispatchMessage(MessageDispatcherImpl.java:302) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:373) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.MessageDispatcherImpl.processMessage(MessageDispatcherImpl.java:333) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.transport.AbstractTransportMapping.fireProcessMessage(AbstractTransportMapping.java:76) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at org.snmp4j.transport.DefaultUdpTransportMapping$ListenThread.run(DefaultUdpTransportMapping.java:414) [2solveAlarmService-1.0.0-jar-with-dependencies.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]

The two oids printed out is the instanceOid and oid in the method.

The exception is being thrown before we enter the listener method. Doing any kind of logging in that method does not print anything.
So the saveTrap method is not even being called before the exception occurs.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

Bizarre. If you look at one of the notification definitions in the MIB, you'll see

eriAlarmMinorAlert NOTIFICATION-TYPE
        OBJECTS {
                eriAlarmAlertManagedObject,
                eriAlarmAlertMajorType,
                eriAlarmAlertMinorType,
                eriAlarmAlertSpecificProblem,
                eriAlarmAlertLastSequenceNo,
                eriAlarmAlertEventType,
                eriAlarmAlertEventTime,
                eriAlarmAlertProbableCause,
                eriAlarmNObjAdditionalText,
                eriAlarmNObjMoreAdditionalText,
                eriAlarmNObjResourceId
                }
...

Based on this, you'd expect the notification to contain a sequence of varbinds, each containing an instance of each of these object types (defined elsewhere in the same MIB). But it appears that the varbinds contain type OIDs instead of instance OIDS (which would have an additional index suffix on them). I've never seen this done before, and I think it's actually inconsistent with the SNMPv2-SMI. I think it could be fixed by having MibbleIndexExtractor return an empty array if the OID isn't an instance OID. The empty array would be returned to Snmp4jVarbind.getIndexes, which would then be returned to SimpleVarbindFactory, which would treat them as un-indexed values.

I think that would all work, but we won't know for sure until we try. I can make the necessary changes, and push them to master. Are you able to build the current HEAD of master from source to test on your end when I've got a fix ready?

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

I've pushed a fix to master. Let me know if you need help building it from source to test. After you've had a chance to test, we can determine what to do next.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

Thank you so much for these fast replies!

I will pull and try and build a a new version and test it.

I will let you know how it goes :)

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

So it looks much better now!!

However there are still some varbinds that arent being "translated" properly.

Heres the log:

[DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105288917 1.3.6.1.6.3.1.1.4.1.0=[I@22e26c87 1.3.6.1.6.3.18.1.3.0=[B@31c262e3 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498723 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,11:51:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 747 O2/APT "TPBSC1_G17_Q4"U 190320 1151
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP1_TPVMSC2

PLIP PRIP REASON
10.44.72.2 10.44.82.98 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=241084 } } }
2019-03-20 11:51:42,216 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105288917 1.3.6.1.6.3.1.1.4.1.0=[I@22e26c87 1.3.6.1.6.3.18.1.3.0=[B@5adf7283 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498723 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,11:51:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 747 O2/APT "TPBSC1_G17_Q4"U 190320 1151
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP1_TPVMSC2

PLIP PRIP REASON
10.44.72.2 10.44.82.98 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=241084 } } }
2019-03-20 11:51:42,360 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@6e44e04c
2019-03-20 11:51:42,362 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105288917 1.3.6.1.6.3.1.1.4.1.0=[I@55f399cd 1.3.6.1.6.3.18.1.3.0=[B@5ccef2d7 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498723 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 11:51:42,363 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105288917 1.3.6.1.6.3.1.1.4.1.0=[I@55f399cd 1.3.6.1.6.3.18.1.3.0=[B@1e16a578 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498723 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 11:51:42,391 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@6e44e04c
2019-03-20 11:51:45,230 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105289222 1.3.6.1.6.3.1.1.4.1.0=[I@2984423a 1.3.6.1.6.3.18.1.3.0=[B@2f74597 eriAlarmActiveManagedObject=ManagedElement=TPvMME1,SgsnMme=1,PIU=2.1,FaultId=46181312 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498719 eriAlarmActiveSpecificProblem=sctpIPPathFailure eriAlarmActiveEventType=communicationsAlarm eriAlarmActiveEventTime=2019-3-20,11:51:40.0,-3:0 eriAlarmActiveProbableCause=transmitFailure eriAlarmNObjMoreAdditionalText=false eriAlarmNObjAdditionalText=The IP path local IP 10.44.67.61 - remote IP 10.44.104.28 has changed its state to INACTIVE. AssocId is 251 EqPos 2.1, InstId 0. UlpKey is 0x200100fb: HiWord =8193, LoWord(Remote SP)=251. eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=241085 } } }
2019-03-20 11:51:45,231 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105289222 1.3.6.1.6.3.1.1.4.1.0=[I@2984423a 1.3.6.1.6.3.18.1.3.0=[B@29610dd4 eriAlarmActiveManagedObject=ManagedElement=TPvMME1,SgsnMme=1,PIU=2.1,FaultId=46181312 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498719 eriAlarmActiveSpecificProblem=sctpIPPathFailure eriAlarmActiveEventType=communicationsAlarm eriAlarmActiveEventTime=2019-3-20,11:51:40.0,-3:0 eriAlarmActiveProbableCause=transmitFailure eriAlarmNObjMoreAdditionalText=false eriAlarmNObjAdditionalText=The IP path local IP 10.44.67.61 - remote IP 10.44.104.28 has changed its state to INACTIVE. AssocId is 251 EqPos 2.1, InstId 0. UlpKey is 0x200100fb: HiWord =8193, LoWord(Remote SP)=251. eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=241085 } } }
2019-03-20 11:51:45,280 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@6e44e04c

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

Great. Glad we improved it.

I think the other problem is being caused by a MIB search ordering problem. I'm making a fix for that now. Will update you shortly.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

Awesome :) I really appriciate the help!

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

The OIDs that aren't being resolved are part of the SNMPv2-MIB (a.k.a. the RFC1213-MIB). I pushed a change that ensures that MIBs are searched in the reverse order in which they are loaded, which is what is needed since MIBs often import things from previously loaded MIBs. Using the specific MIBs you're loading, the resulting Mib instance can now resolve names for those OIDs. Pull and rebuild and let me know how that works for you.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

The log produces this now:

2019-03-20 13:25:44,789 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105853180 1.3.6.1.6.3.1.1.4.1.0=[I@749d94ef 1.3.6.1.6.3.18.1.3.0=[B@36fb9d48 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498989 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,13:25:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 119 O2/APT "TPBSC1_G17_Q4"U 190320 1325
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP2_TPVMSC1

PLIP PRIP REASON
10.44.72.3 10.44.66.114 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=242102 } } }
2019-03-20 13:25:44,798 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105853180 1.3.6.1.6.3.1.1.4.1.0=[I@749d94ef 1.3.6.1.6.3.18.1.3.0=[B@277e01b6 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498989 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,13:25:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 119 O2/APT "TPBSC1_G17_Q4"U 190320 1325
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP2_TPVMSC1

PLIP PRIP REASON
10.44.72.3 10.44.66.114 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=242102 } } }
2019-03-20 13:25:45,410 INFO [main ContextHandler.java:855] - Started o.e.j.s.ServletContextHandler@534c6767{/api,null,AVAILABLE}
2019-03-20 13:25:45,425 INFO [main AbstractConnector.java:292] - Started ServerConnector@360bc645{HTTP/1.1,[http/1.1]}{0.0.0.0:9010}
2019-03-20 13:25:45,425 INFO [main Server.java:407] - Started @2721ms
2019-03-20 13:25:45,605 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@17fce2e4
2019-03-20 13:25:45,606 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105853180 1.3.6.1.6.3.1.1.4.1.0=[I@51c1dfcb 1.3.6.1.6.3.18.1.3.0=[B@2261deaf eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498989 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 13:25:45,607 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105853180 1.3.6.1.6.3.1.1.4.1.0=[I@51c1dfcb 1.3.6.1.6.3.18.1.3.0=[B@76498a9 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498989 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 13:25:45,639 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@17fce2e4
2019-03-20 13:25:53,769 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105854080 1.3.6.1.6.3.1.1.4.1.0=[I@2ebeb0b6 1.3.6.1.6.3.18.1.3.0=[B@2869768 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498986 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,13:25:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 117 O2/APT "TPBSC1_G17_Q4"U 190320 1325
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP1_TPVMSC1

PLIP PRIP REASON
10.44.72.2 10.44.66.98 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=242103 } } }
2019-03-20 13:25:53,770 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105854080 1.3.6.1.6.3.1.1.4.1.0=[I@2ebeb0b6 1.3.6.1.6.3.18.1.3.0=[B@2184e641 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498986 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,13:25:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 117 O2/APT "TPBSC1_G17_Q4"U 190320 1325
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP1_TPVMSC1

PLIP PRIP REASON
10.44.72.2 10.44.66.98 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=242103 } } }
2019-03-20 13:25:53,813 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@17fce2e4
2019-03-20 13:25:53,814 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105854080 1.3.6.1.6.3.1.1.4.1.0=[I@7b8dab05 1.3.6.1.6.3.18.1.3.0=[B@4d865ecb eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498986 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 13:25:53,815 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:66] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105854080 1.3.6.1.6.3.1.1.4.1.0=[I@7b8dab05 1.3.6.1.6.3.18.1.3.0=[B@4bb61fd4 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498986 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-20 13:25:53,840 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@17fce2e4
2019-03-20 13:25:54,770 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ 1.3.6.1.2.1.1.3.0=105854180 1.3.6.1.6.3.1.1.4.1.0=[I@11f16c88 1.3.6.1.6.3.18.1.3.0=[B@6e7e187b eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5498987 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-20,13:25:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 118 O2/APT "TPBSC1_G17_Q4"U 190320 1325
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

Still a few oids left to be translated.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

Interesting. Just to confirm that the name resolution problem in the MIB is fixed, try adding this to your code right after you construct the Mib instance:

logger.debug("test OID-to-instance-name: {}", mib.oidToInstanceName("1.3.6.1.2.1.1.3.0"));

Should output sysUpTime.0.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

Hi again :)

I wrote that logger debug line after the MIB has been loaded

Output from log:
2019-03-21 05:35:04,846 DEBUG [main AlarmReceiver.java:61] - test OID-to-instance-name: 1.3.6.1.2.1.1.3.0

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

I am going to try something, I will let you know how it goes.

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

So reason why it didnt get translated before was i messed up with some MIBs.
Now I am getting this from the log

2019-03-21 08:32:00,064 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:27.04 internet.6.3.1.1.4.1.0=[I@38a6d347 internet.6.3.18.1.3.0=[B@7b0b459c eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506810 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-21,8:31:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 345 O2/APT "TPBSC1_G17_Q4"U 190321 0831
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP2_TPVMSC1

PLIP PRIP REASON
10.44.72.3 10.44.66.114 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=252728 } } }
2019-03-21 08:32:00,078 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:90] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:27.04 internet.6.3.1.1.4.1.0=[I@38a6d347 internet.6.3.18.1.3.0=[B@67f7af35 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506810 eriAlarmActiveSpecificProblem=SCTP ON CP PREFERRED PRIMARY PATH FAILURE eriAlarmActiveEventType=other eriAlarmActiveEventTime=2019-3-21,8:31:0.0,-3:0 eriAlarmActiveProbableCause=m3100Indeterminate eriAlarmNObjMoreAdditionalText=true eriAlarmNObjAdditionalText=Event Type = Switching; Probable Cause = SWITCHING DEVICES; *** ALARM 345 O2/APT "TPBSC1_G17_Q4"U 190321 0831
SCTP ON CP PREFERRED PRIMARY PATH FAILURE

SAID
SCTP2_TPVMSC1

PLIP PRIP REASON
10.44.72.3 10.44.66.114 P eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmActiveLastSequenceNo=252728 } } }
2019-03-21 08:32:00,160 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@160bc405
2019-03-21 08:32:00,161 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:27.04 internet.6.3.1.1.4.1.0=[I@e5f159d internet.6.3.18.1.3.0=[B@2a3aa5c7 eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506810 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-21 08:32:00,164 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:90] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:27.04 internet.6.3.1.1.4.1.0=[I@e5f159d internet.6.3.18.1.3.0=[B@4b6bf78e eriAlarmActiveManagedObject=MeContext=TPBSC1,ManagedElement=TPBSC1 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506810 eriAlarmNObjAdditionalText=PP NOT USED AS APP

END eriAlarmActiveResourceId=0.0 eriAlarmNObjAdditionalInfo= } } }
2019-03-21 08:32:00,194 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@160bc405
2019-03-21 08:32:06,260 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:147] - listener 10.60.219.91/162 notifying handlers for event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:33.31 internet.6.3.1.1.4.1.0=[I@62cc5c68 internet.6.3.18.1.3.0=[B@760f1038 eriAlarmActiveManagedObject=MeContext=TPvIPW2,ManagedElement=TPvIPW2,SystemFunctions=1,Pm=1,PmJob=ENUMTPSDefaultJob,MeasurementReader=mr_1:PL-3 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506812 eriAlarmActiveSpecificProblem=ENUM, Query Failure Error eriAlarmActiveEventType=qualityOfServiceAlarm eriAlarmActiveEventTime=2019-3-21,8:32:1.0,-3:0 eriAlarmActiveProbableCause=x733ThresholdCrossed eriAlarmNObjMoreAdditionalText=false eriAlarmNObjAdditionalText=The alarm is raised when query failures exceed a configured limit (threshold) on expiration of a configured time interval. eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=252729 } } }
2019-03-21 08:32:06,266 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 AlarmReceiver.java:90] - Event: { source=10.60.219.91/162, subject={ type=TRAP peer=10.44.79.95/161 varbinds={ sysUpTime.0=13d 01:08:33.31 internet.6.3.1.1.4.1.0=[I@62cc5c68 internet.6.3.18.1.3.0=[B@bfcd53e eriAlarmActiveManagedObject=MeContext=TPvIPW2,ManagedElement=TPvIPW2,SystemFunctions=1,Pm=1,PmJob=ENUMTPSDefaultJob,MeasurementReader=mr_1:PL-3 eriAlarmActiveMajorType=193 eriAlarmActiveMinorType=5506812 eriAlarmActiveSpecificProblem=ENUM, Query Failure Error eriAlarmActiveEventType=qualityOfServiceAlarm eriAlarmActiveEventTime=2019-3-21,8:32:1.0,-3:0 eriAlarmActiveProbableCause=x733ThresholdCrossed eriAlarmNObjMoreAdditionalText=false eriAlarmNObjAdditionalText=The alarm is raised when query failures exceed a configured limit (threshold) on expiration of a configured time interval. eriAlarmNObjResourceId=false eriAlarmNObjAdditionalInfo= eriAlarmNObjMoreAdditionalInfo=false eriAlarmNObjRecordType=alarmNew eriAlarmActiveLastSequenceNo=252729 } } }
2019-03-21 08:32:06,316 DEBUG [DefaultUDPTransportMapping_10.60.219.91/162 Snmp4jListener.java:156] - event was handled by com._2operate._2solve.alarm.service.receiver.AlarmReceiver$1@160bc405

Only a few oids that arent being translated now.

from tnm4j.

ceharris avatar ceharris commented on June 12, 2024

So partial names like internet.6.3.1.1.4.1.0 happen when the order in which the MIBs are loaded is incorrect and/or there's overlap between loaded MIBs.

In this particular case, I'm most suspicious of

mib.load("RFC1155-SMI");
mib.load("RFC1158-MIB");
mib.load("RFC-1212");
mib.load("RFC1213-MIB");

The RFC1155-SMI and RFC1158-MIB, if loaded at all, should be loaded before any of the SNMPv2-* mibs.

RFC1212 is already covered by SNMPv2-TC and shouldn't be loaded at all.

RFC1213-MIB is superseded by SNMPv2-MIB, which should be used in preference, and should be loaded after SNMPv2-TC and before SNMPv2-CONF

RFC1271-MIB is superseded by RMON-MIB, which should be used in preference and is already in the list.

OID 1.3.6.1.6.3.1.1.4.1.0 is defined in SNMPv2-MIB, which isn't being loaded.
OID 1.3.6.1.6.3.18.1.3.0 is defined in the SNMP-COMMUNITY-MIB, which isn't being loaded.

A useful technique for figuring out what MIB(s) is/are missing when you see a numeric OID is to google for the OID string. You can then look at the MIB text to see what it imports and make sure you've got it ordered so that all of its dependencies are first.

Taking all this into account, I would load the Mib instance this way:

Mib mib = MibFactory.getInstance().newMib();
mib.load("RFC1155-SMI");
mib.load("RFC1158-MIB");
mib.load("SNMPv2-SMI");
mib.load("SNMPv2-TC");
mib.load("SNMPv2-MIB");                      
mib.load("SNMPv2-CONF");
mib.load("SNMP-FRAMEWORK-MIB");
mib.load("SNMP-COMMUNITY-MIB");
mib.load("SNMP-TARGET-MIB");
mib.load("SNMP-NOTIFICATION-MIB");
mib.load("IANA-ITU-ALARM-TC-MIB");
mib.load("ITU-ALARM-TC-MIB");
mib.load("INET-ADDRESS-MIB");
mib.load("RMON-MIB");
mib.load("TOKEN-RING-RMON-MIB");
mib.load("RMON2-MIB");
mib.load("ALARM-MIB");
mib.load("ERICSSON-TOP-MIB");
mib.load("ERICSSON-TC-MIB");
mib.load("ERICSSON-ALARM-TC-MIB");
mib.load("ERICSSON-ALARM-PC-MIB");
mib.load("ERICSSON-ALARM-MIB");

from tnm4j.

2operate avatar 2operate commented on June 12, 2024

With the loading order of the MIBs you proposed it works now :) Everything gets translated properly! Thank you very much for your help. You have saved me from a lot of extra work :)

from tnm4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.