Skip to content

Instantly share code, notes, and snippets.

@ntalbott
Created December 11, 2008 20:17
Show Gist options
  • Save ntalbott/34856 to your computer and use it in GitHub Desktop.
Save ntalbott/34856 to your computer and use it in GitHub Desktop.
def manager(&lam)
SNMP::Manager.open(@manager_config, &lam)
end
def walk_table(table, &block)
manager do |m|
m.walk(table) { |row| yield row.collect{ |vb| vb.value.to_s } }
end
end
def get_mac(vlan_index, ip_address)
manager do |m|
m.get_value("ipNetToMediaPhysAddress.#{vlan_index}.#{ip_address}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment