Created
December 11, 2008 20:17
-
-
Save ntalbott/34856 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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