Sha256: 8e161a15558052c033b3aeaba30b48827420de31ba42f78fa95eef8d0a8d825d

Contents?: true

Size: 407 Bytes

Versions: 10

Compression:

Stored size: 407 Bytes

Contents

require 'snmp'
include SNMP

host = ARGV[0] || 'localhost'

manager = Manager.new(:Host => host, :Port => 161)
ifTable = ObjectId.new("1.3.6.1.2.1.2.2")
next_oid = ifTable
while next_oid.subtree_of?(ifTable)
    response = manager.get_next(next_oid)
    varbind = response.varbind_list.first
    next_oid = varbind.name
    puts "#{varbind.name.to_s}  #{varbind.value.to_s}  #{varbind.value.asn1_type}"
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
snmp-1.0.3 examples/iftable.rb
snmp-1.0.2 examples/iftable.rb
snmp-0.5.1 examples/iftable.rb
snmp-1.0.0 examples/iftable.rb
snmp-0.5.0 examples/iftable.rb
snmp-0.4.0 examples/iftable.rb
snmp-0.6.1 examples/iftable.rb
snmp-1.0.1 examples/iftable.rb
snmp-0.4.1 examples/iftable.rb
snmp-0.6.0 examples/iftable.rb