snmputils

<img src=“https://travis-ci.org/teddyphreak/ruby-snmputils.png”> <img src=“https://codeclimate.com/github/teddyphreak/ruby-snmputils.png”> <img src=“https://gemnasium.com/teddyphreak/ruby-snmputils.png”>

Functional wrappers for Dave Halliday’s ruby-snmp

Installation

Add this line to your application’s Gemfile:

gem 'snmputils'

And then execute:

bundle

Or install it yourself as:

gem install snmputils

Usage

require snmputils

SNMPUtils.get({:host => 'localhost'}, 'SNMPv2-MIB::sysName.0')
# => {"SNMPv2-MIB::sysName.0"=>"localhost", "1.3.6.1.2.1.1.5.0"=>"localhost"}

SNMPUtils.walk({:host => 'localhost'}, ['SNMPv2-MIB::sysORDescr', 'SNMPv2-MIB::sysORID'])
# => [
#   {
#     "SNMPv2-MIB::sysORDescr"=>"The SNMP Management Architecture MIB.", 
#     "1.3.6.1.2.1.1.9.1.3"=>"The SNMP Management Architecture MIB.", 
#     "SNMPv2-MIB::sysORID"=>"SNMPv2-SMI::snmpModules.10.3.1.1", 
#     "1.3.6.1.2.1.1.9.1.2"=>"SNMPv2-SMI::snmpModules.10.3.1.1"
#   }, 
#   ..., 
#   {
#     "SNMPv2-MIB::sysORDescr"=>"View-based Access Control Model for SNMP.", 
#     "1.3.6.1.2.1.1.9.1.3"=>"View-based Access Control Model for SNMP.", 
#     "SNMPv2-MIB::sysORID"=>"SNMPv2-SMI::snmpModules.16.2.2.1", 
#     "1.3.6.1.2.1.1.9.1.2"=>"SNMPv2-SMI::snmpModules.16.2.2.1"
#   }
# ]

Contributing

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Add some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request

License

MIT License