Class: Aio::Module::Cmd::Cisco::ShowCPU
- Inherits:
-
Aio::Module::Cmd::Cisco
- Object
- Aio::Module::Cmd
- Aio::Module::Cmd::Cisco
- Aio::Module::Cmd::Cisco::ShowCPU
- Includes:
- Aio::Module
- Defined in:
- lib/modules/cmd/cisco/show_cpu.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 ⇒ ShowCPU
constructor
A new instance of ShowCPU.
- #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 ⇒ ShowCPU
Returns a new instance of ShowCPU.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/modules/cmd/cisco/show_cpu.rb', line 6 def initialize super({ :cmd_full => "show cpu", :cmd_short => "sh cpu", :author => "Elin", :description => "This is Cisco ASA Command# show cpu", :ranking => Ranking_1, :platform => "asa", :benchmark => { :seconds_5 => ["<", 50], :minute_1 => ["<", 50], :minutes_5 => ["<", 50], } }) end |
Instance Method Details
#parse ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/modules/cmd/cisco/show_cpu.rb', line 22 def parse cont = self.context.dup cpu = {} useful[:cpu] = cpu cont.readline_match_block(/1 minute: (?<minute_1>\d+)%; 5 minutes: (?<minutes_5>\d+)%/) do |block| block.warning_serious(cpu, :minute_1, self) block.warning_serious(cpu, :minutes_5, self) end end |