Sha256: b5b6b779782305895f59d592701ed3c42ea41c29d324228248425874d7030ff3
Contents?: true
Size: 822 Bytes
Versions: 18
Compression:
Stored size: 822 Bytes
Contents
#coding=utf-8 require "aio/core" class Aio::Module::Cmd::Maipu::ShowIpRouteStat < Aio::Module::Cmd::Maipu include Aio::Module def initialize super({ :cmd_full => "show ip route statistic", :cmd_short => "sh ip rou stat", :author => "Elin", :description => "This is Maipu Command# show ip route statistic", :ranking => Ranking_1, :platform => "all", :benchmark => {} }) end def parse cont = self.context.dup stat = {} useful[:route_summary] = stat cont.readline_match_block(/Statistics for the route/) {|b|b} cont.readline_match_block_loop(/(?<proto>[^s]+) (?<count>\d+)/, reg_blank) do |block| route = {} proto = block[:proto].strip useful[:route_summary][proto.to_sym] = route block.update(route, :proto) block.update(route, :count) end end end
Version data entries
18 entries across 18 versions & 1 rubygems