summaryrefslogtreecommitdiff
path: root/lib/oxidized/model
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/model')
-rw-r--r--lib/oxidized/model/asa.rb3
-rw-r--r--lib/oxidized/model/datacom.rb7
-rw-r--r--lib/oxidized/model/gaiaos.rb46
-rw-r--r--lib/oxidized/model/screenos.rb1
-rw-r--r--lib/oxidized/model/timos.rb71
5 files changed, 120 insertions, 8 deletions
diff --git a/lib/oxidized/model/asa.rb b/lib/oxidized/model/asa.rb
index 1e45a91..a41348e 100644
--- a/lib/oxidized/model/asa.rb
+++ b/lib/oxidized/model/asa.rb
@@ -13,6 +13,9 @@ class ASA < Oxidized::Model
cmd :secret do |cfg|
cfg.gsub! /enable password (\S+) (.*)/, 'enable password <secret hidden> \2'
cfg.gsub! /username (\S+) password (\S+) (.*)/, 'username \1 password <secret hidden> \3'
+ cfg.gsub! /ikev2 pre-shared-key (\S+)/, 'ikev2 pre-shared-key <secret hidden>'
+ cfg.gsub! /ikev2 (remote|local)-authentication pre-shared-key (\S+)/, 'ikev2 \1-authentication pre-shared-key <secret hidden>'
+ cfg.gsub! /^(aaa-server TACACS\+ \(\S+\) host.*\n\skey) \S+$/m, '\1 <secret hidden>'
cfg
end
diff --git a/lib/oxidized/model/datacom.rb b/lib/oxidized/model/datacom.rb
index 54091ed..5dbc080 100644
--- a/lib/oxidized/model/datacom.rb
+++ b/lib/oxidized/model/datacom.rb
@@ -24,7 +24,12 @@ class DataCom < Oxidized::Model
cfg.cut_head
end
- cfg :telnet, :ssh do
+ cfg :ssh do
+ password /^Password:\s$/
+ pre_logout 'exit'
+ end
+
+ cfg :telnet do
username /login:\s$/
password /^Password:\s$/
pre_logout 'exit'
diff --git a/lib/oxidized/model/gaiaos.rb b/lib/oxidized/model/gaiaos.rb
new file mode 100644
index 0000000..434e774
--- /dev/null
+++ b/lib/oxidized/model/gaiaos.rb
@@ -0,0 +1,46 @@
+class GaiaOS < Oxidized::Model
+
+ # CheckPoint - Gaia OS Model
+
+ # Gaia Prompt
+ prompt /^([\[\]\w.@:-]+[#>]\s?)$/
+
+ # Comment tag
+ comment '# '
+
+
+ cmd :all do |cfg|
+ cfg = cfg.each_line.to_a[1..-2].join
+ end
+
+ cmd :secret do |cfg|
+ cfg.gsub! /^(set expert-password-hash ).*/, '\1<EXPERT PASSWORD REMOVED>'
+ cfg.gsub! /^(set user \S+ password-hash ).*/,'\1<USER PASSWORD REMOVED>'
+ cfg.gsub! /^(set ospf .* secret ).*/,'\1<OSPF KEY REMOVED>'
+ cfg.gsub! /^(set snmp community )(.*)( read-only.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
+ cfg.gsub! /^(add snmp .* community )(.*)(\S?.*)/,'\1<SNMP COMMUNITY REMOVED>\3'
+ cfg.gsub! /(auth|privacy)(-pass-phrase-hashed )(\S*)/,'\1-pass-phrase-hashed <SNMP PASS-PHRASE REMOVED>'
+ cfg
+ end
+
+ cmd 'show asset all' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show version all' do |cfg|
+ comment cfg
+ end
+
+ cmd 'show configuration' do |cfg|
+ cfg.gsub! /^# Exported by \S+ on .*/, '# '
+ cfg
+ end
+
+
+ cfg :ssh do
+ # User shell must be /etc/cli.sh
+ post_login 'set clienv rows 0'
+ pre_logout 'exit'
+ end
+
+end
diff --git a/lib/oxidized/model/screenos.rb b/lib/oxidized/model/screenos.rb
index 7ee9d9f..0258898 100644
--- a/lib/oxidized/model/screenos.rb
+++ b/lib/oxidized/model/screenos.rb
@@ -20,6 +20,7 @@ class ScreenOS < Oxidized::Model
cmd 'get system' do |cfg|
cfg.gsub! /^Date\ .*\n/, ''
cfg.gsub! /^Up\ .*\n/, ''
+ cfg.gsub! /(current bw ).*/, '\\1 <removed>'
comment cfg
end
diff --git a/lib/oxidized/model/timos.rb b/lib/oxidized/model/timos.rb
index dc28580..d40e845 100644
--- a/lib/oxidized/model/timos.rb
+++ b/lib/oxidized/model/timos.rb
@@ -1,8 +1,10 @@
class TiMOS < Oxidized::Model
- # Alcatel-Lucent TiMOS (Timetra)
- # used in SR/ESS/SAS routers
-
+ #
+ # 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?)$/
@@ -12,26 +14,81 @@ class TiMOS < Oxidized::Model
new_cfg << cfg.each_line.to_a[1..-2].join
end
+ #
+ # Show the boot options file.
+ #
cmd 'show bof' do |cfg|
comment cfg
end
+ #
+ # Show the system information.
+ #
cmd 'show system information' do |cfg|
- # strip uptime
+ #
+ # Strip uptime.
+ #
cfg.sub! /^System Up Time.*\n/, ''
comment cfg
end
+ #
+ # Show the card state.
+ #
cmd 'show card state' do |cfg|
comment cfg
end
- cmd 'show boot-messages' do |cfg|
- cfg.gsub! /\r/, ""
+ #
+ # 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"
+ comment cfg
+ end
+
+ #
+ # Show the running debug configuration.
+ #
+ cmd 'show debug' do |cfg|
comment cfg
end
- cmd 'admin display-config'
+ #
+ # Show the saved debug configuration (admin debug-save).
+ #
+ cmd 'file type config.dbg' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ comment cfg
+ end
+
+ #
+ # Show the running persistent indices.
+ #
+ cmd 'admin display-config index' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ comment cfg
+ end
+
+ #
+ # Show the running configuration.
+ #
+ cmd 'admin display-config' do |cfg|
+ #
+ # Strip carriage returns.
+ #
+ cfg.gsub! /\r/, ''
+ end
cfg :telnet do
username /^Login: /