summaryrefslogtreecommitdiff
path: root/lib/oxidized
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized')
-rw-r--r--lib/oxidized/hook/githubrepo.rb25
-rw-r--r--lib/oxidized/model/aosw.rb2
-rw-r--r--lib/oxidized/model/arbos.rb27
-rw-r--r--lib/oxidized/model/aricentiss.rb53
-rw-r--r--lib/oxidized/model/br6910.rb2
-rw-r--r--lib/oxidized/model/dcnos.rb48
-rw-r--r--lib/oxidized/model/dnos.rb9
-rw-r--r--lib/oxidized/model/edgecos.rb47
-rw-r--r--lib/oxidized/model/edgeos.rb6
-rw-r--r--lib/oxidized/model/firewareos.rb2
-rw-r--r--lib/oxidized/model/fortios.rb5
-rw-r--r--lib/oxidized/model/hpebladesystem.rb10
-rw-r--r--lib/oxidized/model/junos.rb5
-rw-r--r--lib/oxidized/model/nxos.rb1
-rw-r--r--lib/oxidized/model/powerconnect.rb2
-rw-r--r--lib/oxidized/model/procurve.rb4
-rw-r--r--lib/oxidized/model/sros.rb118
-rw-r--r--lib/oxidized/model/supermicro.rb47
-rw-r--r--lib/oxidized/model/timos.rb120
-rw-r--r--lib/oxidized/model/vyatta.rb6
20 files changed, 361 insertions, 178 deletions
diff --git a/lib/oxidized/hook/githubrepo.rb b/lib/oxidized/hook/githubrepo.rb
index d33e54e..4cae4e6 100644
--- a/lib/oxidized/hook/githubrepo.rb
+++ b/lib/oxidized/hook/githubrepo.rb
@@ -45,16 +45,23 @@ class GithubRepo < Oxidized::Hook
private
def credentials
- @credentials ||= if cfg.has_key?('username') && cfg.has_key?('password')
- log "Using https auth", :debug
- Rugged::Credentials::UserPassword.new(username: cfg.username, password: cfg.password)
- else
- if cfg.has_key?('publickey') && cfg.has_key?('privatekey')
- log "Using ssh auth with key", :debug
- Rugged::Credentials::SshKey.new(username: 'git', publickey: File.expand_path(cfg.publickey), privatekey: File.expand_path(cfg.privatekey))
+ Proc.new do |url, username_from_url, allowed_types|
+
+ if cfg.has_key?('username')
+ git_user = cfg.username
+ else
+ git_user = username_from_url ? username_from_url : 'git'
+ end
+
+ if cfg.has_key?('password')
+ log "Authenticating using username and password as '#{git_user}'", :debug
+ Rugged::Credentials::UserPassword.new(username: git_user, password: cfg.password)
+ elsif cfg.has_key?('publickey') && cfg.has_key?('privatekey')
+ log "Authenticating using ssh keys as '#{git_user}'", :debug
+ Rugged::Credentials::SshKey.new(username: git_user, publickey: File.expand_path(cfg.publickey), privatekey: File.expand_path(cfg.privatekey), passphrase: ENV["OXIDIZED_SSH_PASSPHRASE"])
else
- log "Using ssh auth with agentforwarding", :debug
- Rugged::Credentials::SshKeyFromAgent.new(username: 'git')
+ log "Authenticating using ssh agent as '#{git_user}'", :debug
+ Rugged::Credentials::SshKeyFromAgent.new(username: git_user)
end
end
end
diff --git a/lib/oxidized/model/aosw.rb b/lib/oxidized/model/aosw.rb
index a85ead7..71fde2e 100644
--- a/lib/oxidized/model/aosw.rb
+++ b/lib/oxidized/model/aosw.rb
@@ -11,7 +11,7 @@ class AOSW < Oxidized::Model
# All IAPs connected to a Instant Controller will have the same config output. Only the controller needs to be monitored.
comment '# '
- prompt /^\(?.+\)?\s?[#>]/
+ prompt /^\(?.+\)?\s[#>]/
cmd :all do |cfg|
cfg.each_line.to_a[1..-2].join
diff --git a/lib/oxidized/model/arbos.rb b/lib/oxidized/model/arbos.rb
new file mode 100644
index 0000000..389f3f6
--- /dev/null
+++ b/lib/oxidized/model/arbos.rb
@@ -0,0 +1,27 @@
+class ARBOS < Oxidized::Model
+
+ # Arbor OS model #
+
+ prompt /^[\S\s]+\n([\w.@-]+[:\/#>]+)\s?$/
+ comment '# '
+
+ cmd 'system hardware' do |cfg|
+ 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
+
+ cmd 'system version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'config show' do |cfg|
+ cfg
+ end
+
+ cfg :ssh do
+ exec true
+ pre_logout 'exit'
+ end
+end
diff --git a/lib/oxidized/model/aricentiss.rb b/lib/oxidized/model/aricentiss.rb
new file mode 100644
index 0000000..14f8502
--- /dev/null
+++ b/lib/oxidized/model/aricentiss.rb
@@ -0,0 +1,53 @@
+# Developed against:
+# #show version
+# Switch ID Hardware Version Firmware Version
+# 0 SSE-G48-TG4 (P2-01) 1.0.16-9
+
+class AricentISS < Oxidized::Model
+
+ prompt (/^(\e\[27m)?[ \r]*[\w-]+# ?$/)
+
+ cfg :ssh do
+ # "pagination" was misspelled in some (earlier) versions (at least 1.0.16-9)
+ # 1.0.18-15 is known to include the corrected spelling
+ post_login 'no cli pagination'
+ post_login 'no cli pagignation'
+ pre_logout 'exit'
+ end
+
+ cmd :all do |cfg|
+ # * Drop first line that contains the command, and the last line that
+ # contains a prompt
+ # * Strip carriage returns
+ cfg.delete("\r").each_line.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub(/^(snmp community) .*/, '\1 <hidden>')
+ end
+
+ cmd 'show system information' do |cfg|
+ cfg.sub! /^Device Up Time.*\n/, ''
+ cfg.delete! "\r"
+ comment(cfg).gsub(/ +$/, '')
+ end
+
+ cmd 'show running-config' do |cfg|
+ comment_next = 0
+ cfg.each_line.map { |l|
+ next '' if l.match /^Building configuration/
+
+ if l.match /^Switch ID.*Hardware Version.*Firmware Version/ then
+ comment_next = 2
+ end
+
+ if comment_next > 0 then
+ comment_next -= 1
+ next comment(l)
+ end
+
+ l
+ }.join.gsub(/ +$/, '')
+ end
+
+end
diff --git a/lib/oxidized/model/br6910.rb b/lib/oxidized/model/br6910.rb
index b5c9bcf..df93793 100644
--- a/lib/oxidized/model/br6910.rb
+++ b/lib/oxidized/model/br6910.rb
@@ -1,7 +1,7 @@
class BR6910 < Oxidized::Model
- prompt /^Vty-[0-9]\#$/
+ prompt /^([\w.@()-]+[#>]\s?)$/
comment '! '
# not possible to disable paging prior to show running-config
diff --git a/lib/oxidized/model/dcnos.rb b/lib/oxidized/model/dcnos.rb
new file mode 100644
index 0000000..8506280
--- /dev/null
+++ b/lib/oxidized/model/dcnos.rb
@@ -0,0 +1,48 @@
+# DCNOS is a ZebOS derivative by DCN (http://www.dcnglobal.com/)
+# In addition to products by DCN (now Yunke China), this OS type
+# powers a number of re-branded OEM devices.
+
+# Developed against SNR S2950-24G 7.0.3.5
+
+class DCNOS < Oxidized::Model
+
+ comment '! '
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-1].join
+ end
+
+ cmd 'show version' do |cfg|
+ cfg.gsub! /\s(Uptime is).*/, ''
+ comment cfg
+ end
+
+ cmd 'show boot-files' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show flash' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show running-config' do |cfg|
+ cfg
+ end
+
+ cfg :telnet do
+ username /^login:/i
+ password /^password:/i
+ end
+
+ cfg :telnet, :ssh do
+ if vars :enable
+ post_login do
+ send "enable\n"
+ cmd vars(:enable)
+ end
+ end
+ post_login 'terminal length 0'
+ pre_logout 'exit'
+ end
+
+end
diff --git a/lib/oxidized/model/dnos.rb b/lib/oxidized/model/dnos.rb
index a44630e..5c3cd53 100644
--- a/lib/oxidized/model/dnos.rb
+++ b/lib/oxidized/model/dnos.rb
@@ -5,6 +5,7 @@ class DNOS < Oxidized::Model
comment '! '
cmd :all do |cfg|
+ cfg.gsub! /^% Invalid input detected at '\^' marker\.$|^\s+\^$/, ''
cfg.each_line.to_a[2..-2].join
end
@@ -22,6 +23,14 @@ class DNOS < Oxidized::Model
comment cfg
end
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show system' do |cfg|
+ comment cfg
+ end
+
cmd 'show running-config' do |cfg|
cfg = cfg.each_line.to_a[3..-1].join
cfg
diff --git a/lib/oxidized/model/edgecos.rb b/lib/oxidized/model/edgecos.rb
new file mode 100644
index 0000000..bc205f5
--- /dev/null
+++ b/lib/oxidized/model/edgecos.rb
@@ -0,0 +1,47 @@
+class EdgeCOS < Oxidized::Model
+
+ comment '! '
+
+ cmd :secret do |cfg|
+ cfg.gsub!(/password \d+ (\S+).*/, '<secret removed>')
+ cfg.gsub!(/community (\S+)/, 'community <hidden>')
+ cfg
+ end
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[2..-2].join
+ end
+
+ cmd 'show running-config'
+
+ cmd 'show access-list tcam-utilization' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show memory' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show system' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show version' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show watchdog' do |cfg|
+ comment cfg
+ end
+
+ cfg :telnet do
+ username /^Username:/
+ password /^Password:/
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'terminal length 0'
+ pre_logout 'exit'
+ end
+
+end
diff --git a/lib/oxidized/model/edgeos.rb b/lib/oxidized/model/edgeos.rb
index 2a8d663..aa7a197 100644
--- a/lib/oxidized/model/edgeos.rb
+++ b/lib/oxidized/model/edgeos.rb
@@ -9,11 +9,15 @@ class Edgeos < Oxidized::Model
end
cmd :secret do |cfg|
+ cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
+ cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
+ cfg.gsub! /password (\S+).*/, 'password <secret removed>'
+ cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
cfg.gsub! /community (\S+) {/, 'community <hidden> {'
cfg
end
- cmd 'show configuration | no-more'
+ cmd 'show configuration commands | no-more'
cfg :telnet do
username /login:\s/
diff --git a/lib/oxidized/model/firewareos.rb b/lib/oxidized/model/firewareos.rb
index f456c60..1b3d07c 100644
--- a/lib/oxidized/model/firewareos.rb
+++ b/lib/oxidized/model/firewareos.rb
@@ -1,6 +1,6 @@
class FirewareOS < Oxidized::Model
- prompt /^([\w.@-]+[#>]\s?)$/
+ prompt /^\[?\w*\]?\w*?(<\w*>)?(#|>)\s*$/
comment '-- '
cmd :all do |cfg|
diff --git a/lib/oxidized/model/fortios.rb b/lib/oxidized/model/fortios.rb
index bffaf3c..9287dce 100644
--- a/lib/oxidized/model/fortios.rb
+++ b/lib/oxidized/model/fortios.rb
@@ -15,7 +15,7 @@ class FortiOS < Oxidized::Model
end
cmd :secret do |cfg|
- cfg.gsub! /(set (?:passwd|password|psksecret|secret|key|group-password|secondary-secret|tertiary-secret|auth-password-l1|auth-password-l2|rsso|history0|history1|inter-controller-key ENC)).*/, '\\1 <configuration removed>'
+ cfg.gsub! /(set (?:passwd|password|psksecret|secret|key|group-password|secondary-secret|tertiary-secret|auth-password-l1|auth-password-l2|rsso|history0|history1|inter-controller-key ENC|passphrase ENC|login-passwd ENC)).*/, '\\1 <configuration removed>'
cfg.gsub! /(set private-key).*-+END ENCRYPTED PRIVATE KEY-*"$/m , '\\1 <configuration removed>'
cfg.gsub! /(set ca ).*-+END CERTIFICATE-*"$/m , '\\1 <configuration removed>'
cfg.gsub! /(set csr ).*-+END CERTIFICATE REQUEST-*"$/m , '\\1 <configuration removed>'
@@ -49,7 +49,7 @@ class FortiOS < Oxidized::Model
cfg << cmd('end') if @vdom_enabled
- cfg << cmd('show full-configuration')
+ cfg << cmd('show full-configuration | grep .')
cfg.join "\n"
end
@@ -63,4 +63,3 @@ cfg << cmd('end') if @vdom_enabled
end
end
-
diff --git a/lib/oxidized/model/hpebladesystem.rb b/lib/oxidized/model/hpebladesystem.rb
index 5e34de8..27673de 100644
--- a/lib/oxidized/model/hpebladesystem.rb
+++ b/lib/oxidized/model/hpebladesystem.rb
@@ -4,10 +4,10 @@ class HPEBladeSystem < Oxidized::Model
prompt /.*> /
comment '# '
- expect /^\s*--More--\s+.*$/ do |data, re|
- send ' '
- data.sub re, ''
- end
+ #expect /^\s*--More--\s+.*$/ do |data, re|
+ # send ' '
+ # data.sub re, ''
+ #end
cmd :all do |cfg|
cfg = cfg.delete("\r").each_line.to_a[0..-1].map{|line|line.rstrip}.join("\n") + "\n"
@@ -40,6 +40,7 @@ class HPEBladeSystem < Oxidized::Model
end
cmd 'show network' do |cfg|
+ cfg.gsub! /Last Update:.*$/i, ''
comment cfg
end
@@ -78,6 +79,7 @@ class HPEBladeSystem < Oxidized::Model
end
cfg :telnet, :ssh do
+ post_login "set script mode on"
pre_logout "exit"
end
end
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb
index 2f59414..2ea0179 100644
--- a/lib/oxidized/model/junos.rb
+++ b/lib/oxidized/model/junos.rb
@@ -13,7 +13,10 @@ class JunOS < Oxidized::Model
end
cmd :secret do |cfg|
- cfg.gsub!(/encrypted-password (\S+).*/, '<secret removed>')
+ cfg.gsub!(/encrypted-password (\S+).*/, 'encrypted-password <secret removed>')
+ cfg.gsub!(/pre-shared-key ascii-text (\S+).*/, 'pre-shared-key ascii-text <secret removed>')
+ cfg.gsub!(/pre-shared-key hexadecimal (\S+).*/, 'pre-shared-key hexadecimal <secret removed>')
+ cfg.gsub!(/authentication-key (\S+).*/, 'authentication-key <secret removed>')
cfg.gsub!(/community (\S+) {/, 'community <hidden> {')
cfg
end
diff --git a/lib/oxidized/model/nxos.rb b/lib/oxidized/model/nxos.rb
index e743415..60d6037 100644
--- a/lib/oxidized/model/nxos.rb
+++ b/lib/oxidized/model/nxos.rb
@@ -22,6 +22,7 @@ class NXOS < Oxidized::Model
cmd 'show running-config' do |cfg|
cfg.gsub! /^!Time:[^\n]*\n/, ''
+ cfg
end
cfg :ssh, :telnet do
diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb
index 61e1cf2..f602a36 100644
--- a/lib/oxidized/model/powerconnect.rb
+++ b/lib/oxidized/model/powerconnect.rb
@@ -14,7 +14,7 @@ class PowerConnect < Oxidized::Model
end
cmd :secret do |cfg|
- cfg.gsub! /^username (\S+) password \S+ (.*)/, 'username \1 password <hidden> \2'
+ cfg.gsub! /^(username \S+ password (?:encrypted )?)\S+(.*)/, '\1<hidden>\2'
cfg
end
diff --git a/lib/oxidized/model/procurve.rb b/lib/oxidized/model/procurve.rb
index 11d7ea9..444fb5b 100644
--- a/lib/oxidized/model/procurve.rb
+++ b/lib/oxidized/model/procurve.rb
@@ -47,6 +47,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
diff --git a/lib/oxidized/model/sros.rb b/lib/oxidized/model/sros.rb
new file mode 100644
index 0000000..289bed3
--- /dev/null
+++ b/lib/oxidized/model/sros.rb
@@ -0,0 +1,118 @@
+class SROS < Oxidized::Model
+
+ #
+ # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent).
+ # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP.
+ #
+
+ comment '# '
+
+ prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/
+
+ cmd :all do |cfg, cmdstring|
+ new_cfg = comment "COMMAND: #{cmdstring}\n"
+ new_cfg << cfg.each_line.to_a[1..-2].join
+ end
+
+ #
+ # Show the boot options file.
+ #
+ cmd 'show bof' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the system information.
+ #
+ cmd 'show system information' do |cfg|
+ #
+ # Strip uptime.
+ #
+ cfg.sub! /^System Up Time.*\n/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the card state.
+ #
+ cmd 'show card state' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the boot log.
+ #
+ cmd 'file type bootlog.txt' do |cfg|
+ #
+ # Strip carriage returns and backspaces.
+ #
+ cfg.gsub! /\r/, ''
+ cfg.gsub! /[\b][\b][\b]/, "\n"
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the running debug configuration.
+ #
+ cmd 'show debug' do |cfg|
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the saved debug configuration (admin debug-save).
+ #
+ cmd 'file type config.dbg' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the running persistent indices.
+ #
+ cmd 'admin display-config index' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ comment cfg
+ end
+
+ #
+ # Show the running configuration.
+ #
+ cmd 'admin display-config' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ cfg.gsub! /# Finished .*/, ''
+ cfg.gsub! /# Generated .*/, ''
+ end
+
+ cfg :telnet do
+ username /^Login: /
+ password /^Password: /
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'environment no more'
+ pre_logout 'logout'
+ end
+end
diff --git a/lib/oxidized/model/supermicro.rb b/lib/oxidized/model/supermicro.rb
index 361244c..56d5ef6 100644
--- a/lib/oxidized/model/supermicro.rb
+++ b/lib/oxidized/model/supermicro.rb
@@ -1,45 +1,10 @@
-class Supermicro < Oxidized::Model
- comment '! '
+# Backward compatibility shim for deprecated model `supermicro`.
+# Migrate your source from `supermicro` to `edgecos`.
- cmd :secret do |cfg|
- cfg.gsub!(/password \d+ (\S+).*/, '<secret removed>')
- cfg.gsub!(/community (\S+)/, 'community <hidden>')
- cfg
- end
+require_relative 'edgecos.rb'
- cmd :all do |cfg|
- cfg.each_line.to_a[2..-2].join
- end
+Supermicro = EdgeCOS
- cmd 'show running-config'
+Oxidized.logger.warn "Using deprecated model supermicro, use edgecos instead."
- cmd 'show access-list tcam-utilization' do |cfg|
- comment cfg
- end
-
- cmd 'show memory' do |cfg|
- comment cfg
- end
-
- cmd 'show system' do |cfg|
- comment cfg
- end
-
- cmd 'show version' do |cfg|
- comment cfg
- end
-
- cmd 'show watchdog' do |cfg|
- comment cfg
- end
-
- cfg :telnet do
- username /^Username:/
- password /^Password:/
- end
-
- cfg :telnet, :ssh do
- post_login 'terminal length 0'
- pre_logout 'exit'
- end
-end \ No newline at end of file
+# Deprecated
diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb
index c230a8f..e454630 100644
--- a/lib/oxidized/model/timos.rb
+++ b/lib/oxidized/model/timos.rb
@@ -1,118 +1,10 @@
-class TiMOS < Oxidized::Model
+# Backward compatibility shim for deprecated model `timos`.
+# Migrate your source from `timos` to `sros`.
- #
- # Nokia SR OS (TiMOS) (formerly TiMetra, Alcatel, Alcatel-Lucent).
- # Used in 7705 SAR, 7210 SAS, 7450 ESS, 7750 SR, 7950 XRS, and NSP.
- #
+require_relative 'sros.rb'
- comment '# '
+TiMOS = SROS
- prompt /^([-\w\.:>\*]+\s?[#>]\s?)$/
+Oxidized.logger.warn "Using deprecated model timos, use sros instead."
- cmd :all do |cfg, cmdstring|
- new_cfg = comment "COMMAND: #{cmdstring}\n"
- new_cfg << cfg.each_line.to_a[1..-2].join
- end
-
- #
- # Show the boot options file.
- #
- cmd 'show bof' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the system information.
- #
- cmd 'show system information' do |cfg|
- #
- # Strip uptime.
- #
- cfg.sub! /^System Up Time.*\n/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the card state.
- #
- cmd 'show card state' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the boot log.
- #
- cmd 'file type bootlog.txt' do |cfg|
- #
- # Strip carriage returns and backspaces.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /[\b][\b][\b]/, "\n"
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running debug configuration.
- #
- cmd 'show debug' do |cfg|
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the saved debug configuration (admin debug-save).
- #
- cmd 'file type config.dbg' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running persistent indices.
- #
- cmd 'admin display-config index' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- comment cfg
- end
-
- #
- # Show the running configuration.
- #
- cmd 'admin display-config' do |cfg|
- #
- # Strip carriage returns.
- #
- cfg.gsub! /\r/, ''
- cfg.gsub! /# Finished .*/, ''
- cfg.gsub! /# Generated .*/, ''
- end
-
- cfg :telnet do
- username /^Login: /
- password /^Password: /
- end
-
- cfg :telnet, :ssh do
- post_login 'environment no more'
- pre_logout 'logout'
- end
-end
+# Deprecated
diff --git a/lib/oxidized/model/vyatta.rb b/lib/oxidized/model/vyatta.rb
index 8d977aa..57ec9d3 100644
--- a/lib/oxidized/model/vyatta.rb
+++ b/lib/oxidized/model/vyatta.rb
@@ -9,11 +9,15 @@ class Vyatta < Oxidized::Model
end
cmd :secret do |cfg|
+ cfg.gsub! /encrypted-password (\S+).*/, 'encrypted-password <secret removed>'
+ cfg.gsub! /plaintext-password (\S+).*/, 'plaintext-password <secret removed>'
+ cfg.gsub! /password (\S+).*/, 'password <secret removed>'
+ cfg.gsub! /pre-shared-secret (\S+).*/, 'pre-shared-secret <secret removed>'
cfg.gsub! /community (\S+) {/, 'community <hidden> {'
cfg
end
- cmd 'show configuration | no-more'
+ cmd 'show configuration commands | no-more'
cfg :telnet do
username /login:\s/