Skip to content

snmpboy/MIBBLER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

MIBBLER – A wrapper for MIBBLE.jar www.mibble.org

Summary

MIBBLER is a Jruby wrapper around mibble.jar. It allows for parsing a mib, loading other mibs, and is meant to be used with Mark Cotner’s SNMP4J. It has one class, Loaded_mibs. Accroding to the Mibble documentation MibLoader is not thread safe, therefore, create one instance and use that instance throughout your code.

Features

  • Use Ruby scripts to take advantage of Mibble’s compile Java code.

  • Parse a mib to get OID’s matched with their human readable values.

  • Load more mibs. By default it uses /usr/share/mibs but you may change the directory.

Usage

The example is a modified example from SNMP4JR

#!/usr/bin/env jruby

require ‘rubygems’ require ‘SNMP4JR’ require ‘MIBBLER’

# This defaults to version 2c bulkwalk(most efficient method) unless you specify version1

# Create an instance of Loaded_mibs to manipulate the Mibs. Public methods are: parse_mib, load_mib, and get_oid

mymibs = Loaded_mibs.new oids = mymibs.get_oid(‘dot1dBasePort’, ‘sysDescr’)

target = SNMPTarget.new(:host => ‘<switch-ip-address>’, :community => ‘public’,

:version => SNMP4JR::MP::Version2c)

target.max_repetitions = 1 target.non_repeaters = 2

target.get_bulk(oids).each do |vb|
  puts vb.to_s

end

About

Jruby wrapper for MIBBLE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages