• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MIB Parsing in Java

 
Mahfuzul islam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am recieveing SNMP Trap From CISCO Switch in My Server and getting SNMP as format:

obid = value
TRAP[requestID=18, errorStatus=Success(0), errorIndex=0, VBS[1.3.6.1.2.1.1.3.0 = 0:16:07.79;
1.3.6.1.6.3.1.1.4.1.0 = 1.3.6.1.4.1.9.9.41.2.0.1;
1.3.6.1.4.1.9.9.41.1.2.3.1.2.2 = LINK;
1.3.6.1.4.1.9.9.41.1.2.3.1.3.2 = 4;
1.3.6.1.4.1.9.9.41.1.2.3.1.4.2 = UPDOWN;
1.3.6.1.4.1.9.9.41.1.2.3.1.5.2 = Interface FastEthernet0/24, changed state to down; 1.3.6.1.4.1.9.9.41.1.2.3.1.6.2 = 0:16:07.79]]


obId :
I can parse MIBs for CISCO switch uisng java and can list out all obid with its name from a MIB file.
Question 1) How I can know the incoming SNMP is coming using whinch MIB of CISCO? There are soo many MIB files.

values:
Question 2) Different Value Blue Marked are meaningfull but some numberic value is also I am getting [red marked] For Such red marked value Ho I need to get its Measning from MIB?

I think there is some mapping value agains this redmarked value.

I have used mibbrowser to analyze this but not sound also targt is need to get a way to get the value in java.


Like:
ds1IntervalUASs=1.3.6.1.2.1.10.18.2.1.6
ds1IntervalNumber=1.3.6.1.2.1.10.18.2.1.2
ds1ConfigEntry=1.3.6.1.2.1.10.18.1.1
ds1Loopback=1.3.6.1.2.1.10.18.1.1.7
ds1YellowAlarm=1.3.6.1.2.1.10.18.1.1.9
ds1TotalEntry=1.3.6.1.2.1.10.18.4.1
ds1CurrentESs=1.3.6.1.2.1.10.18.3.1.2
ds1CSUIndex=1.3.6.1.2.1.10.18.1.1.1
ds1ZeroCoding=1.3.6.1.2.1.10.18.1.1.6
ds1TotalTable=1.3.6.1.2.1.10.18.4
ds1TotalESs=1.3.6.1.2.1.10.18.4.1.2
ds1CircuitIdentifier=1.3.6.1.2.1.10.18.1.1.11
ds1CurrentTable=1.3.6.1.2.1.10.18.3
ds1TotalBPVs=1.3.6.1.2.1.10.18.4.1.7
ds1TotalSEFSs=1.3.6.1.2.1.10.18.4.1.4
....
...
....


Please show me some path...idea?Please Answer my 2 Questions.

Thanks!



 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mahfuzul islam wrote:
Question 1) How I can know the incoming SNMP is coming using whinch MIB of CISCO? There are soo many MIB files.


It's been a while since I've worked with SNMP, but doesn't a MIB include metadata telling us the root(s?) of the subtree(?s) it covers?

Question 2) Different Value Blue Marked are meaningfull but some numberic value is also I am getting [red marked] For Such red marked value Ho I need to get its Measning from MIB?


I'm not sure I understand the question. Are you saying that value is like an enum rather than a simple numerical quantity? Such as, for example, 1=good, 2=warning, 3=disaster. If that's the case, then, again, I think the MIB should have some indication of the meanings of those numbers, but even if it does, it will still take human intervention to deal with them accordingly.

I used to use http://www.mibdepot.com when I wanted to look up OIDs' meanings. You might see what it has to say.

In fact, I just looked myself out of curiosity. MibDepot says 1.3.6.1.4.1.9.9.41.1.2.3.1.3 is "clogHistSeverity", and its syntax is SyslogSeverity. The description is "The severity of the message." Clicking the SyslogSeverity link, we find the meanings of the values.

So you can go back to the MIB and see if you can find the corresponding info there, and then play around until you discover how to extract it.

And finally, I'm not sure if you know this, but the final ".2" on all those OIDs in the trap mean that they're referring to the interface with index 2. (Although that index is going to number the interfaces however the SNMP agent chooses to do so, not necessarily corresponding to what you consider interface #2 on that host the indices are primarily used to associate data together. So if we see a bunch of data for tabular OIDs ending in .1 and a bunch ending in .2, we know the .1 stuff is all for one "object" and the .2 stuff is all for a different "object" of the same type.)
 
Mahfuzul islam
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Jeff,

Thanks! For your reply. I have solved my problem after devlop a mib lookup. using this This lookup, ani incoming obid can be look up from mib to find out value.

That solved my proble.
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic