Method: Corona::Core#poll
- Defined in:
- lib/corona/core.rb
#poll(ip) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/corona/core.rb', line 54 def poll ip result = nil snmp = SNMP.new ip.to_s, @community oids = snmp.dbget if oids return nil if oids[:sysDescr] == ::SNMP::NoSuchObject result = {:oids=>oids, :ip=>ip, :int=>'n/a'} if index = snmp.ip2index(ip.to_s) if int = snmp.ifdescr(index) result[:int] = int.downcase else Log.debug "no ifDescr for #{index} at #{ip}" end else Log.debug "no ifIndex for #{ip}" end end snmp.close result end |