Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ints = Hash.new
- Device.all.each do |d|
- if d.hostname =~ /rwc.*idf/
- d.interfaces.each do |i|
- ints[i.speed] = 0 unless ints.has_key?(i.speed)
- ints[i.speed] += 1 if (i.up? || (!i.up? && i.last_changed > 30.days.ago))
- end
- end
- end
- ints.each_pair do |speed,count|
- puts "#{speed}: #{count}"
- end
Add Comment
Please, Sign In to add comment