Sha256: 08a2a5184ae7daa149a633c1df6052f619e149f3424e22bc56e89958aa34e0d1

Contents?: true

Size: 639 Bytes

Versions: 3

Compression:

Stored size: 639 Bytes

Contents

require "snmpjr/version"
require "snmpjr/getter"
require "snmpjr/target"

class Snmpjr

  def initialize options = {}
    @host = options.fetch(:host)
    @port = options.fetch(:port) || 161
    @community = options.fetch(:community)
  end

  def get oids
    target = Snmpjr::Target.new.create(:host => @host, :port => @port, :community => @community)
    getter = Snmpjr::Getter.new(target)

    case oids.class.to_s
    when 'String'
      getter.get oids
    when 'Array'
      getter.get_multiple oids
    else
      raise ArgumentError.new 'You can request a single Oid using a String, or multiple using an Array'
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
snmpjr-0.1.4-java lib/snmpjr.rb
snmpjr-0.1.2-java lib/snmpjr.rb
snmpjr-0.1.3-java lib/snmpjr.rb