Class: Aio::Module::Cmd::Cisco::ShowFailover
- Inherits:
-
Aio::Module::Cmd::Cisco
- Object
- Aio::Module::Cmd
- Aio::Module::Cmd::Cisco
- Aio::Module::Cmd::Cisco::ShowFailover
- Includes:
- Aio::Module
- Defined in:
- lib/modules/cmd/cisco/show_failover.rb
Instance Attribute Summary
Attributes inherited from Aio::Module::Cmd
#cmd_info, #context, #device_info, #ext_info, #useful, #warning_klass
Instance Method Summary collapse
-
#initialize ⇒ ShowFailover
constructor
A new instance of ShowFailover.
- #parse ⇒ Object
Methods inherited from Aio::Module::Cmd
#author, #benchmark, #clear_useful, #cmd_full, #cmd_short, #description, #division, #key_stand, #license, #platform, #ranking, #set_defaults, #type
Methods included from Ui::Verbose
#clear_line, #print_error, #print_good, #progress_bar
Constructor Details
#initialize ⇒ ShowFailover
Returns a new instance of ShowFailover.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/modules/cmd/cisco/show_failover.rb', line 9 def initialize super({ :cmd_full => "show failover", :cmd_short => "sh fail", :author => "Elin", :description => "This is Cisco ASA Command# show failover", :ranking => Ranking_1, :platform => FW, }) end |
Instance Method Details
#parse ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/modules/cmd/cisco/show_failover.rb', line 20 def parse context = self.context.dup failover = {} useful[:failover] = failover context.readline_match_block(/Failover (?<status>.*)/) do |block| block.update(failover, :status) end if failover[:status] =~ /On/ context.readline_match_block(/Failover unit (?<standby>.*)/) do |block| block.update(failover, :standby) end context.readline_match_block(/Failover LAN Interface: failover (?<interface>[^\s]+) \((?<interface_status>[^\)]+)\)/) do |block| block.update(failover, :interface) block.update(failover, :interface_status) end end end |