diff options
27 files changed, 63 insertions, 63 deletions
diff --git a/lib/oxidized/model/acos.rb b/lib/oxidized/model/acos.rb index b75ee98..bc24393 100644 --- a/lib/oxidized/model/acos.rb +++ b/lib/oxidized/model/acos.rb @@ -4,7 +4,7 @@ class ACOS < Oxidized::Model comment '! ' # ACOS prompt changes depending on the state of the device - prompt /^([-\w.\/:?\[\]\(\)]+[#>]\s?)$/ + prompt /^([-\w.\/:?\[\]()]+[#>]\s?)$/ cmd :secret do |cfg| cfg.gsub!(/community read encrypted (\S+)/, 'community read encrypted <hidden>') # snmp diff --git a/lib/oxidized/model/acsw.rb b/lib/oxidized/model/acsw.rb index f792347..baf457b 100644 --- a/lib/oxidized/model/acsw.rb +++ b/lib/oxidized/model/acsw.rb @@ -36,11 +36,11 @@ class ACSW < 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! /^\ tunnel\ mpls\ traffic-eng\ bandwidth[^\n]*\n*( - (?:\ [^\n]*\n*)* - tunnel\ mpls\ traffic-eng\ auto-bw)/mx, '\1' - cfg.gsub! /^([\s\t\!]*Last configuration change ).*/, '' - cfg.gsub! /^([\s\t\!]*NVRAM config last ).*/, '' + cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]*\n*( + (?: [^\n]*\n*)* + tunnel mpls traffic-eng auto-bw)/mx, '\1' + cfg.gsub! /^([\s\t!]*Last configuration change ).*/, '' + cfg.gsub! /^([\s\t!]*NVRAM config last ).*/, '' cfg end diff --git a/lib/oxidized/model/aen.rb b/lib/oxidized/model/aen.rb index b2f4d8a..b2192cf 100644 --- a/lib/oxidized/model/aen.rb +++ b/lib/oxidized/model/aen.rb @@ -3,7 +3,7 @@ class AEN < Oxidized::Model comment '# ' - prompt /^([-\w.\/:?\[\]\(\)]+:\s?)$/ + prompt /^([-\w.\/:?\[\]()]+:\s?)$/ cmd 'configuration generate-script module all' do |cfg| cfg diff --git a/lib/oxidized/model/aireos.rb b/lib/oxidized/model/aireos.rb index d52f7ae..84bbb3f 100644 --- a/lib/oxidized/model/aireos.rb +++ b/lib/oxidized/model/aireos.rb @@ -3,7 +3,7 @@ class Aireos < Oxidized::Model # Used in Cisco WLC 5500 comment '# ' # this complains too, can't find real comment char - prompt /^\([^\)]+\)\s>/ + prompt /^\([^)]+\)\s>/ cmd :all do |cfg| cfg.cut_both diff --git a/lib/oxidized/model/alteonos.rb b/lib/oxidized/model/alteonos.rb index dec4faf..5a5bef3 100644 --- a/lib/oxidized/model/alteonos.rb +++ b/lib/oxidized/model/alteonos.rb @@ -35,13 +35,13 @@ class ALTEONOS < Oxidized::Model end # Answer for Dispay private keys - expect /^Display private keys\?\s?\[y\/n\]\: $/ do |data, re| + expect /^Display private keys\?\s?\[y\/n\]: $/ do |data, re| send "n\r" data.sub re, '' end # Answer for sync to peer on exit - expect /^Confirm Sync to Peer\s?\[y\/n\]\: $/ do |data, re| + expect /^Confirm Sync to Peer\s?\[y\/n\]: $/ do |data, re| send "n\r" data.sub re, '' end diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb index 3e1fd53..fae0eff 100644 --- a/lib/oxidized/model/aosw.rb +++ b/lib/oxidized/model/aosw.rb @@ -25,8 +25,8 @@ class AOSW < Oxidized::Model cfg.gsub!(/ sha (\S+)/, ' sha <secret removed>') cfg.gsub!(/ des (\S+)/, ' des <secret removed>') cfg.gsub!(/mobility-manager (\S+) user (\S+) (\S+)/, 'mobility-manager \1 user \2 <secret removed>') - cfg.gsub!(/mgmt-user (\S+) (root|guest\-provisioning|network\-operations|read\-only|location\-api\-mgmt) (\S+)$/, 'mgmt-user \1 \2 <secret removed>') # MAS & Wireless Controler - cfg.gsub!(/mgmt-user (\S+) (\S+)( (read\-only|guest\-mgmt))?$/, 'mgmt-user \1 <secret removed> \3') # IAP + cfg.gsub!(/mgmt-user (\S+) (root|guest-provisioning|network-operations|read-only|location-api-mgmt) (\S+)$/, 'mgmt-user \1 \2 <secret removed>') # MAS & Wireless Controler + cfg.gsub!(/mgmt-user (\S+) (\S+)( (read-only|guest-mgmt))?$/, 'mgmt-user \1 <secret removed> \3') # IAP # MAS format: mgmt-user <username> <accesslevel> <password hash> # IAP format (root user): mgmt-user <username> <password hash> # IAP format: mgmt-user <username> <password hash> <access level> diff --git a/lib/oxidized/model/apc_aos.rb b/lib/oxidized/model/apc_aos.rb index 5a4d232..76f398c 100644 --- a/lib/oxidized/model/apc_aos.rb +++ b/lib/oxidized/model/apc_aos.rb @@ -1,6 +1,6 @@ class Apc_aos < Oxidized::Model cmd 'config.ini' do |cfg| - cfg.gsub! /^; Configuration file\, generated on.*/, '' + cfg.gsub! /^; Configuration file, generated on.*/, '' end cfg :ftp do diff --git a/lib/oxidized/model/arbos.rb b/lib/oxidized/model/arbos.rb index 51b269d..77de4c9 100644 --- a/lib/oxidized/model/arbos.rb +++ b/lib/oxidized/model/arbos.rb @@ -5,8 +5,8 @@ class ARBOS < Oxidized::Model comment '# ' cmd 'system hardware' do |cfg| - cfg.gsub! /^Boot\ time\:\s.+/, '' # Remove boot timer - cfg.gsub! /^Load\ averages\:\s.+/, '' # Remove CPU load info + cfg.gsub! /^Boot time:\s.+/, '' # Remove boot timer + cfg.gsub! /^Load averages:\s.+/, '' # Remove CPU load info cfg = cfg.each_line.to_a[2..-1].join comment cfg end diff --git a/lib/oxidized/model/c4cmts.rb b/lib/oxidized/model/c4cmts.rb index 222713d..59611e8 100644 --- a/lib/oxidized/model/c4cmts.rb +++ b/lib/oxidized/model/c4cmts.rb @@ -17,7 +17,7 @@ class C4CMTS < Oxidized::Model end cmd 'show environment' do |cfg| - cfg.gsub! /\s+[\-\d]+\s+C\s+[\(\s\d]+\s+\F\)/, '' # remove temperature readings + cfg.gsub! /\s+[\-\d]+\s+C\s+[(\s\d]+\s+F\)/, '' # remove temperature readings comment cfg.cut_both end diff --git a/lib/oxidized/model/ciscosma.rb b/lib/oxidized/model/ciscosma.rb index 5a34f86..a7b7752 100644 --- a/lib/oxidized/model/ciscosma.rb +++ b/lib/oxidized/model/ciscosma.rb @@ -4,7 +4,7 @@ class CiscoSMA < Oxidized::Model comment '! ' # Select passphrase display option - expect /using loadconfig command\. \[Y\]\>/ do |data, re| + expect /using loadconfig command\. \[Y\]>/ do |data, re| send "y\n" data.sub re, '' end diff --git a/lib/oxidized/model/ciscosmb.rb b/lib/oxidized/model/ciscosmb.rb index eef4755..447cb69 100644 --- a/lib/oxidized/model/ciscosmb.rb +++ b/lib/oxidized/model/ciscosmb.rb @@ -36,9 +36,9 @@ class CiscoSMB < Oxidized::Model cfg = cfg.each_line.to_a[0..-1].join cfg.gsub! /^Current configuration : [^\n]*\n/, '' cfg.sub! /^(ntp clock-period).*/, '! \1' - cfg.gsub! /^\ tunnel\ mpls\ traffic-eng\ bandwidth[^\n]*\n*( - (?:\ [^\n]*\n*)* - tunnel\ mpls\ traffic-eng\ auto-bw)/mx, '\1' + cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]*\n*( + (?: [^\n]*\n*)* + tunnel mpls traffic-eng auto-bw)/mx, '\1' cfg end diff --git a/lib/oxidized/model/dlink.rb b/lib/oxidized/model/dlink.rb index a0dbbb8..460edc7 100644 --- a/lib/oxidized/model/dlink.rb +++ b/lib/oxidized/model/dlink.rb @@ -15,7 +15,7 @@ class Dlink < Oxidized::Model end cmd 'show switch' do |cfg| - cfg.gsub! /^System\ Uptime\s.+/, '' # Omit constantly changing uptime info + cfg.gsub! /^System Uptime\s.+/, '' # Omit constantly changing uptime info comment cfg end diff --git a/lib/oxidized/model/edgeos.rb b/lib/oxidized/model/edgeos.rb index a723904..f5374c8 100644 --- a/lib/oxidized/model/edgeos.rb +++ b/lib/oxidized/model/edgeos.rb @@ -1,7 +1,7 @@ class Edgeos < Oxidized::Model # EdgeOS # - prompt /\@.*?\:~\$\s/ + prompt /@.*?:~\$\s/ cmd :all do |cfg| cfg = cfg.lines.to_a[1..-2].join diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb index 6a61aeb..417da03 100644 --- a/lib/oxidized/model/fortios.rb +++ b/lib/oxidized/model/fortios.rb @@ -1,7 +1,7 @@ class FortiOS < Oxidized::Model comment '# ' - prompt /^([-\w\.\~]+(\s[\(\w\-\.\)]+)?\~?\s?[#>$]\s?)$/ + prompt /^([-\w.~]+(\s[(\w\-.)]+)?~?\s?[#>$]\s?)$/ expect /^--More--\s$/ do |data, re| send ' ' diff --git a/lib/oxidized/model/fujitsupy.rb b/lib/oxidized/model/fujitsupy.rb index 6e8f807..a0614f9 100644 --- a/lib/oxidized/model/fujitsupy.rb +++ b/lib/oxidized/model/fujitsupy.rb @@ -1,5 +1,5 @@ class FujitsuPY < Oxidized::Model - prompt /^(\([\w.-]*\)\s#|^\S+\#\s)$/ + prompt /^(\([\w.-]*\)\s#|^\S+#\s)$/ comment '! ' cmd :all do |cfg| @@ -16,7 +16,7 @@ class FujitsuPY < Oxidized::Model cmd 'show system information' do |cfg| cfg.gsub! /^Current-time : [\w\s:]*$/, '' cfg.gsub! /^(\s{33}\^)$/, '' - cfg.gsub! /^(\% Invalid input detected at '\^' marker.)$/, '' + cfg.gsub! /^(% Invalid input detected at '\^' marker.)$/, '' comment cfg end diff --git a/lib/oxidized/model/hirschmann.rb b/lib/oxidized/model/hirschmann.rb index e84b774..0792081 100644 --- a/lib/oxidized/model/hirschmann.rb +++ b/lib/oxidized/model/hirschmann.rb @@ -1,5 +1,5 @@ class Hirschmann < Oxidized::Model - prompt /^[\(\w\s\w\)]+\s[>|#]+?$/ + prompt /^[(\w\s)]+\s[>|#]+?$/ comment '## ' diff --git a/lib/oxidized/model/ios.rb b/lib/oxidized/model/ios.rb index 73fe114..1395ecd 100644 --- a/lib/oxidized/model/ios.rb +++ b/lib/oxidized/model/ios.rb @@ -97,7 +97,7 @@ class IOS < Oxidized::Model comments << "CPU:#{slave} #{cpu}#{cpuxtra}#{slaveslot}"; end - if line.match /^System image file is "([^\"]*)"$/ + if line.match /^System image file is "([^"]*)"$/ comments << "Image: #{$1}" end end @@ -119,9 +119,9 @@ 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! /^\ tunnel\ mpls\ traffic-eng\ bandwidth[^\n]*\n*( - (?:\ [^\n]*\n*)* - tunnel\ mpls\ traffic-eng\ auto-bw)/mx, '\1' + cfg.gsub! /^ tunnel mpls traffic-eng bandwidth[^\n]*\n*( + (?: [^\n]*\n*)* + tunnel mpls traffic-eng auto-bw)/mx, '\1' cfg end diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb index 32dbf47..eefe272 100644 --- a/lib/oxidized/model/ironware.rb +++ b/lib/oxidized/model/ironware.rb @@ -1,5 +1,5 @@ class IronWare < Oxidized::Model - prompt /^.*(telnet|ssh)\@.+[>#]\s?$/i + prompt /^.*(telnet|ssh)@.+[>#]\s?$/i comment '! ' # to handle pager without enable @@ -30,8 +30,8 @@ class IronWare < Oxidized::Model cmd 'show chassis' do |cfg| cfg.encode!("UTF-8", :invalid => :replace, :undef => :replace) # sometimes ironware returns broken encoding cfg.gsub! /(^((.*)Current temp(.*))$)/, '' # remove unwanted lines current temperature - cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}\%\)/, '' # remove unwanted lines Speed Fans - cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}\%\)/, '' + cfg.gsub! /Speed = [A-Z-]{2,6} \(\d{2,3}%\)/, '' # remove unwanted lines Speed Fans + cfg.gsub! /current speed is [A-Z]{2,6} \(\d{2,3}%\)/, '' cfg.gsub! /Fan \d* - STATUS: OK \D*\d*./, '' # Fix for ADX Fan speed reporting cfg.gsub! /\d* deg C/, '' # Fix for ADX temperature reporting cfg.gsub! /([\[]*)1([\]]*)<->([\[]*)2([\]]*)(<->([\[]*)3([\]]*))*/, '' diff --git a/lib/oxidized/model/mlnxos.rb b/lib/oxidized/model/mlnxos.rb index 990417d..80625a1 100644 --- a/lib/oxidized/model/mlnxos.rb +++ b/lib/oxidized/model/mlnxos.rb @@ -3,7 +3,7 @@ class MLNXOS < Oxidized::Model comment '## ' # Pager Handling - expect /.+lines\s\d+\-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re| + expect /.+lines\s\d+-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re| send ' ' data.sub re, '' end @@ -12,10 +12,10 @@ class MLNXOS < Oxidized::Model cfg.gsub! /\[\?1h=\r/, '' # Pager Handling cfg.gsub! /\r\[K/, '' # Pager Handling cfg.gsub! /\s/, '' # Linebreak Handling - cfg.gsub! /^CPU\ load\ averages\:\s.+/, '' # Omit constantly changing CPU info - cfg.gsub! /^System\ memory\:\s.+/, '' # Omit constantly changing memory info - cfg.gsub! /^Uptime\:\s.+/, '' # Omit constantly changing uptime info - cfg.gsub! /.+Generated\ at\s\d+.+/, '' # Omit constantly changing generation time info + cfg.gsub! /^CPU load averages:\s.+/, '' # Omit constantly changing CPU info + cfg.gsub! /^System memory:\s.+/, '' # Omit constantly changing memory info + cfg.gsub! /^Uptime:\s.+/, '' # Omit constantly changing uptime info + cfg.gsub! /.+Generated at\s\d+.+/, '' # Omit constantly changing generation time info cfg = cfg.lines.to_a[2..-3].join end diff --git a/lib/oxidized/model/netscaler.rb b/lib/oxidized/model/netscaler.rb index 00d1b71..278da1b 100644 --- a/lib/oxidized/model/netscaler.rb +++ b/lib/oxidized/model/netscaler.rb @@ -1,5 +1,5 @@ class NetScaler < Oxidized::Model - prompt /^\>\s*$/ + prompt /^>\s*$/ comment '# ' cmd :all do |cfg| diff --git a/lib/oxidized/model/panos.rb b/lib/oxidized/model/panos.rb index 422a9fe..3fdebf7 100644 --- a/lib/oxidized/model/panos.rb +++ b/lib/oxidized/model/panos.rb @@ -3,21 +3,21 @@ class PanOS < Oxidized::Model comment '! ' - prompt /^[\w.\@:\(\)-]+>\s?$/ + prompt /^[\w.@:()-]+>\s?$/ cmd :all do |cfg| cfg.each_line.to_a[2..-3].join end cmd 'show system info' do |cfg| - cfg.gsub! /^(up)?time:\ .*$/, '' - cfg.gsub! /^app-.*?:\ .*$/, '' - cfg.gsub! /^av-.*?:\ .*$/, '' - cfg.gsub! /^threat-.*?:\ .*$/, '' - cfg.gsub! /^wildfire-.*?:\ .*$/, '' - cfg.gsub! /^wf-private.*?:\ .*$/, '' - cfg.gsub! /^url-filtering.*?:\ .*$/, '' - cfg.gsub! /^global-.*?:\ .*$/, '' + cfg.gsub! /^(up)?time: .*$/, '' + cfg.gsub! /^app-.*?: .*$/, '' + cfg.gsub! /^av-.*?: .*$/, '' + cfg.gsub! /^threat-.*?: .*$/, '' + cfg.gsub! /^wildfire-.*?: .*$/, '' + cfg.gsub! /^wf-private.*?: .*$/, '' + cfg.gsub! /^url-filtering.*?: .*$/, '' + cfg.gsub! /^global-.*?: .*$/, '' comment cfg end diff --git a/lib/oxidized/model/routeros.rb b/lib/oxidized/model/routeros.rb index c729126..924a4a1 100644 --- a/lib/oxidized/model/routeros.rb +++ b/lib/oxidized/model/routeros.rb @@ -20,7 +20,7 @@ class RouterOS < Oxidized::Model cfg.gsub! /\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]/, '' # strip ANSI colours cfg.gsub! /\\\r\n\s+/, '' # strip new line cfg.gsub! /# inactive time\r\n/, '' # Remove time based system comment - cfg = cfg.split("\n").reject { |line| line[/^\#\s\w{3}\/\d{2}\/\d{4}.*$/] } + cfg = cfg.split("\n").reject { |line| line[/^#\s\w{3}\/\d{2}\/\d{4}.*$/] } cfg.join("\n") + "\n" end end diff --git a/lib/oxidized/model/screenos.rb b/lib/oxidized/model/screenos.rb index 9b52f9f..d70f5b2 100644 --- a/lib/oxidized/model/screenos.rb +++ b/lib/oxidized/model/screenos.rb @@ -3,7 +3,7 @@ class ScreenOS < Oxidized::Model comment '! ' - prompt /^[\w.:\(\)-]+->\s?$/ + prompt /^[\w.:()-]+->\s?$/ cmd :all do |cfg| cfg.each_line.to_a[2..-2].join @@ -17,8 +17,8 @@ class ScreenOS < Oxidized::Model end cmd 'get system' do |cfg| - cfg.gsub! /^Date\ .*\n/, '' - cfg.gsub! /^Up\ .*\n/, '' + cfg.gsub! /^Date .*\n/, '' + cfg.gsub! /^Up .*\n/, '' cfg.gsub! /(current bw ).*/, '\\1 <removed>' comment cfg end diff --git a/lib/oxidized/model/sros.rb b/lib/oxidized/model/sros.rb index aab7d0e..dede1e8 100644 --- a/lib/oxidized/model/sros.rb +++ b/lib/oxidized/model/sros.rb @@ -6,7 +6,7 @@ class SROS < Oxidized::Model comment '# ' - prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/ + prompt /^([-\w.:>*]+\s?[#>]\s?)$/ cmd :all do |cfg, cmdstring| new_cfg = comment "COMMAND: #{cmdstring}\n" diff --git a/lib/oxidized/model/voltaire.rb b/lib/oxidized/model/voltaire.rb index 62a62e5..4457a1f 100644 --- a/lib/oxidized/model/voltaire.rb +++ b/lib/oxidized/model/voltaire.rb @@ -3,7 +3,7 @@ class VOLTAIRE < Oxidized::Model comment '## ' # Pager Handling - expect /.+lines\s\d+\-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re| + expect /.+lines\s\d+-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re| send ' ' data.sub re, '' end @@ -12,10 +12,10 @@ class VOLTAIRE < Oxidized::Model cfg.gsub! /\[\?1h=\r/, '' # Pager Handling cfg.gsub! /\r\[K/, '' # Pager Handling cfg.gsub! /\s/, '' # Linebreak Handling - cfg.gsub! /^CPU\ load\ averages\:\s.+/, '' # Omit constantly changing CPU info - cfg.gsub! /^System\ memory\:\s.+/, '' # Omit constantly changing memory info - cfg.gsub! /^Uptime\:\s.+/, '' # Omit constantly changing uptime info - cfg.gsub! /.+Generated\ at\s\d+.+/, '' # Omit constantly changing generation time info + cfg.gsub! /^CPU load averages:\s.+/, '' # Omit constantly changing CPU info + cfg.gsub! /^System memory:\s.+/, '' # Omit constantly changing memory info + cfg.gsub! /^Uptime:\s.+/, '' # Omit constantly changing uptime info + cfg.gsub! /.+Generated at\s\d+.+/, '' # Omit constantly changing generation time info cfg = cfg.lines.to_a[2..-3].join end diff --git a/lib/oxidized/model/voss.rb b/lib/oxidized/model/voss.rb index 32958ce..7950386 100644 --- a/lib/oxidized/model/voss.rb +++ b/lib/oxidized/model/voss.rb @@ -14,10 +14,10 @@ class Voss < Oxidized::Model # Get sys-info and remove information that changes such has temperature and power cmd 'show sys-info' do |cfg| cfg.gsub! /(^((.*)SysUpTime(.*))$)/, 'removed SysUpTime' - cfg.gsub! /^((.*)Temperature Info \:(.*\r?\n){4})/, 'removed Temperature Info and 3 more lines' - cfg.gsub! /(^((.*)AmbientTemperature(.*)\:(.*))$)/, 'removed AmbientTemperature' - cfg.gsub! /(^((.*)Temperature(.*)\:(.*))$)/, 'removed Temperature' - cfg.gsub! /(^((.*)Total Power Usage(.*)\:(.*))$)/, 'removed Total Power Usage' + cfg.gsub! /^((.*)Temperature Info :(.*\r?\n){4})/, 'removed Temperature Info and 3 more lines' + cfg.gsub! /(^((.*)AmbientTemperature(.*):(.*))$)/, 'removed AmbientTemperature' + cfg.gsub! /(^((.*)Temperature(.*):(.*))$)/, 'removed Temperature' + cfg.gsub! /(^((.*)Total Power Usage(.*):(.*))$)/, 'removed Total Power Usage' comment "#{cfg}\n" end diff --git a/lib/oxidized/model/vyatta.rb b/lib/oxidized/model/vyatta.rb index fb6b0d1..c36c38c 100644 --- a/lib/oxidized/model/vyatta.rb +++ b/lib/oxidized/model/vyatta.rb @@ -1,7 +1,7 @@ class Vyatta < Oxidized::Model # Brocade Vyatta / VyOS model # - prompt /\@.*?\:~\$\s/ + prompt /@.*?:~\$\s/ cmd :all do |cfg| cfg = cfg.lines.to_a[1..-2].join |