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