File: dump_yaml.rb

package info (click to toggle)
ruby-snmp 1.3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,860 kB
  • sloc: ruby: 1,791; makefile: 9
file content (13 lines) | stat: -rw-r--r-- 225 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'rubygems'
require 'snmp'
require 'yaml'

varbinds = []
SNMP::Manager.open do |snmp|
  snmp.walk("ifTable") do |vb|
    varbinds << [vb.name.to_s, vb.value.to_s, vb.value.class.to_s]
  end
end

puts varbinds.to_yaml