Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- puts "autonomous_system_name\tcider\tpercentage"
- @all_stats.each do |stat|
- asys = stat.autonomous_system
- name = asys.name
- pgbb = stat.percentages_grouped_by_block
- pgbb.each do |k ,v|
- puts "#{name}\t#{k}\t#{v}"
- end
- end
- __END__
- input
- @all_stats=
- [#<LowIpAlertStat:0x7f5af0527cc0
- @autonomous_system=
- #<AutonomousSystem id: 11, name: "DFW", number: 33070, description: "DFW", created_at: nil, updated_at: "2013-09-04 19:30:06", owner_number: "DCO1", private: false, autonomous_system_id: nil, network_environment_id: 55, low_ip_alert_check: true, low_ip_alert_threshold: 70>,
- @percentages_grouped_by_block=
- {"166.78.42.0/23"=>100.0,
- "166.78.33.0/24"=>100.0,
- "209.61.129.0/24"=>100.0,
- "166.78.36.0/22"=>99.21875,
- "166.78.32.0/24"=>100.0,
- "209.61.131.0/24"=>100.0,
- "209.61.128.0/24"=>100.0,
- "50.56.228.0/24"=>100.0},>]
- =>nil
- desired out put
- autonomous_system_name cider percentage
- DFW 166.78.42.0/23 100
- DFW 166.78.33.0/24 100
- DFW 209.61.129.0/24 100.0
- DFW 166.78.36.0/22 99.21875
Advertisement
Add Comment
Please, Sign In to add comment