diff options
author | Neil Lathwood <neil@lathwood.co.uk> | 2018-04-27 10:51:39 +0100 |
---|---|---|
committer | Neil Lathwood <neil@lathwood.co.uk> | 2018-04-27 10:51:39 +0100 |
commit | 6574f129bca9633d728c178b12e49a2e9be89cdd (patch) | |
tree | a2d630fca3156658aea07469b9a5c3fdf00f6846 /lib/oxidized/model/procurve.rb | |
parent | d96cfac1f09ff4055f54ab604358290865d41f62 (diff) | |
parent | 34fd5369feee94ab45c5a81d7769b1df717e4c8c (diff) |
Rebased from master
Diffstat (limited to 'lib/oxidized/model/procurve.rb')
-rw-r--r-- | lib/oxidized/model/procurve.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/oxidized/model/procurve.rb b/lib/oxidized/model/procurve.rb index 180b703..930dc53 100644 --- a/lib/oxidized/model/procurve.rb +++ b/lib/oxidized/model/procurve.rb @@ -1,10 +1,9 @@ class Procurve < Oxidized::Model - # some models start lines with \r # previous command is repeated followed by "\eE", which sometimes ends up on last line prompt /^\r?([\w.-]+# )$/ - comment '! ' + comment '! ' # replace next line control sequence with a new line expect /(\e\[1M\e\[\??\d+(;\d+)*[A-Za-z]\e\[1L)|(\eE)/ do |data, re| @@ -21,6 +20,11 @@ class Procurve < Oxidized::Model "" end + expect /Enter switch number/ do + send "\n" + "" + end + cmd :all do |cfg| cfg = cfg.each_line.to_a[1..-2].join cfg = cfg.gsub /^\r/, '' @@ -42,6 +46,10 @@ class Procurve < Oxidized::Model comment cfg end + cmd 'show system power-supply' do |cfg| + comment cfg + end + cmd 'show interfaces transceiver' do |cfg| comment cfg end @@ -58,7 +66,7 @@ class Procurve < Oxidized::Model # not supported on all models cmd 'show system information' do |cfg| - cfg = cfg.each_line.select { |line| not line.match /(.*CPU.*)|(.*Up Time.*)|(.*Total.*)|(.*Free.*)|(.*Lowest.*)|(.*Missed.*)/ } + cfg = cfg.each_line.reject { |line| line.match /(.*CPU.*)|(.*Up Time.*)|(.*Total.*)|(.*Free.*)|(.*Lowest.*)|(.*Missed.*)/ } cfg = cfg.join comment cfg end @@ -78,5 +86,4 @@ class Procurve < Oxidized::Model cfg :ssh do pty_options({ chars_wide: 1000 }) end - end |