diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c78bcfa4..72ccad225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ * FEATURE: add hpmsm model (@timwsuqld) * FEATURE: add FastIron model (@ZacharyPuls) * FEATURE: add Linuxgeneric model (@davama) +* FEATURE: add SpeedTouch model (@raunz) * BUGFIX: improve procurve telnet support for older switches (@deajan) * BUGFIX: voss model * BUGFIX: cambium model should not consider timestamp for backup as unneeded, and causes diffs (@cchance27) @@ -24,6 +25,9 @@ * BUGFIX: remove stray whitespace in adtran model (@nickhilliard) * BUGFIX: if input model returns subclassed string we may overwrite the string with an empty string * BUGFIX: updated aosw.rb prompt. addresses issue #1254 +* BUGFIX: update comware model to fix telnet login/password for HPE MSR954 and HPE5130. Issue #1886 +* BUGFIX: filter out IOS configuration/NVRAM modified/changed timestamps to keep output persistent +* BUGFIX: update screenos model to reduce the amount of lines being stripped from beginning of cfg output * MISC: add pgsql support, mechanized and net-tftp to Dockerfile * MISC: upgrade slop, net-telnet and rugged * MISC: extra secret scrubbing in comware model (@bengels00) diff --git a/docs/Supported-OS-Types.md b/docs/Supported-OS-Types.md index d668ffd03..5ab193657 100644 --- a/docs/Supported-OS-Types.md +++ b/docs/Supported-OS-Types.md @@ -182,6 +182,8 @@ * [SonicOS](lib/oxidized/model/sonicos.rb) * SNR * [SNR-S300G, S2xxx, S3xxx, S4xxx](/lib/oxidized/model/dcnos.rb) +* Speedtouch + * [Thomson Speedtouch](/lib/oxidized/model/speedtouch.rb) * Supermicro * [SSE-G2252, G2252P](/lib/oxidized/model/edgecos.rb) * [SSE-G48-TG4, G24-TG4](/lib/oxidized/model/aricentiss.rb) diff --git a/lib/oxidized/model/comware.rb b/lib/oxidized/model/comware.rb index 5ebcb3c29..1218e556c 100644 --- a/lib/oxidized/model/comware.rb +++ b/lib/oxidized/model/comware.rb @@ -26,8 +26,8 @@ class Comware < Oxidized::Model end cfg :telnet do - username /^Username:$/ - password /^Password:$/ + username /^(Username|login):/ + password /^Password:/ end cfg :telnet, :ssh do diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index 1135c6bf4..3e1453184 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -95,6 +95,7 @@ class IOS < Oxidized::Model cmd 'show vtp status' do |cfg| cfg.gsub! /^$\n/, '' + cfg.gsub! /Configuration last modified by.*\n/, '' cfg.gsub! /^/, 'VTP: ' unless cfg.empty? comment "#{cfg}\n" end @@ -107,6 +108,8 @@ class IOS < Oxidized::Model cfg = cfg.each_line.to_a[3..-1] cfg = cfg.reject { |line| line.match /^ntp clock-period / }.join cfg.gsub! /^Current configuration : [^\n]*\n/, '' + cfg.gsub! /^! (Last|No) configuration change (at|since).*\n/, '' + cfg.gsub! /^! NVRAM config last updated.*\n/, '' cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]*\n*( (?: [^\n]*\n*)* tunnel mpls traffic-eng auto-bw)/mx, '\1' diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 70b654b6c..3a5886036 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -51,6 +51,7 @@ class IronWare < Oxidized::Model cmd 'show flash' do |cfg| cfg.gsub! /(\d+) bytes/, '' # Fix for ADX flash size + cfg.gsub! /(^((.*)Code Flash Free Space(.*))$)/, '' # Brocade comment cfg end diff --git a/lib/oxidized/model/screenos.rb b/lib/oxidized/model/screenos.rb index d70f5b2e3..43ec554bd 100644 --- a/lib/oxidized/model/screenos.rb +++ b/lib/oxidized/model/screenos.rb @@ -6,7 +6,7 @@ class ScreenOS < Oxidized::Model prompt /^[\w.:()-]+->\s?$/ cmd :all do |cfg| - cfg.each_line.to_a[2..-2].join + cfg.each_line.to_a[1..-2].join end cmd :secret do |cfg| @@ -24,8 +24,7 @@ class ScreenOS < Oxidized::Model end cmd 'get config' do |cfg| - cfg = cfg.each_line.to_a[3..-1].join - cfg + cfg.each_line.to_a[1..-1].join end cfg :telnet do diff --git a/lib/oxidized/model/speedtouch.rb b/lib/oxidized/model/speedtouch.rb new file mode 100644 index 000000000..81547a9a7 --- /dev/null +++ b/lib/oxidized/model/speedtouch.rb @@ -0,0 +1,34 @@ +class SpeedTouch < Oxidized::Model + prompt /([\w{}=]+[>])$/ + comment '! ' + + expect /login$/ do + send "\n" + "" + end + + cmd ':env list' do |cfg| + cfg.each_line.select do |line| + (not line.match /:env list$/) && + (not line.match /{\w+}=>$/) + end.join + comment cfg + end + + cmd ':config dump' do |cfg| + cfg.each_line.select do |line| + (not line.match /:config dump$/) && + (not line.match /{\w+}=>$/) + end.join + cfg + end + + cfg :telnet do + username /^Username : / + password /^Password : / + end + + cfg :telnet do + pre_logout 'exit' + end +end