Sha256: cd797f2fc7f8ed0a39cd07a8ef900aaa6847af9ac1f619ded1fde9b2a95b3715
Contents?: true
Size: 958 Bytes
Versions: 18
Compression:
Stored size: 958 Bytes
Contents
#coding=utf-8 require "aio/core" class Aio::Module::Cmd::Cisco::ShowIpOspfNeighbor < Aio::Module::Cmd::Cisco include Aio::Module def initialize super({ :cmd_full => "show ip ospf neighbor", :cmd_short => "sh ip o n", :author => "Elin", :description => "This is Cisco Command# show ip ospf neighbor", :ranking => Ranking_1, :platform => "all", }) end def parse context = self.context.dup useful[:ospf_neighbor] = {} context.readline_match_block(/Neighbor ID/) {|b|b} count = 0 context.readline_match_block_loop(/(?<neighbor_id>[^\s]+) (?<pri>\d+) (?<state>[^\s]+) (.*) (?<address>[^\s]+) (?<interface>.*)/, reg_blank) do |block| nei = {} nei_id = block[:neighbor_id] useful[:ospf_neighbor][nei_id.to_sym] = nei block.update(nei, :neighbor_id) block.update(nei, :pri) block.update(nei, :state) block.update(nei, :address) block.update(nei, :interface) count += 1 end end end
Version data entries
18 entries across 18 versions & 1 rubygems