diff options
Diffstat (limited to 'lib/oxidized/model/junos.rb')
-rw-r--r-- | lib/oxidized/model/junos.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/oxidized/model/junos.rb b/lib/oxidized/model/junos.rb index 058e3cf..737a000 100644 --- a/lib/oxidized/model/junos.rb +++ b/lib/oxidized/model/junos.rb @@ -1,6 +1,5 @@ class JunOS < Oxidized::Model - - comment '# ' + comment '# ' def telnet @input.class.to_s.match(/Telnet/) @@ -8,11 +7,15 @@ class JunOS < Oxidized::Model cmd :all do |cfg| cfg = cfg.lines.to_a[1..-2].join if screenscrape + cfg.gsub!(/ scale-subscriber (\s+)(\d+)/, ' scale-subscriber <count>') cfg.lines.map { |line| line.rstrip }.join("\n") + "\n" 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 @@ -28,7 +31,7 @@ class JunOS < Oxidized::Model out = '' case @model when 'mx960' - out << cmd('show chassis fabric reachability') { |cfg| comment cfg } + out << cmd('show chassis fabric reachability') { |cfg| comment cfg } when /^(ex22|ex33|ex4|ex8|qfx)/ out << cmd('show virtual-chassis') { |cfg| comment cfg } end @@ -36,6 +39,8 @@ class JunOS < Oxidized::Model end cmd('show chassis hardware') { |cfg| comment cfg } + cmd('show system license') { |cfg| comment cfg } + cmd('show system license keys') { |cfg| comment cfg } cfg :telnet do username(/^login:/) @@ -43,7 +48,7 @@ class JunOS < Oxidized::Model end cfg :ssh do - exec true # don't run shell, run each command in exec channel + exec true # don't run shell, run each command in exec channel end cfg :telnet, :ssh do @@ -51,5 +56,4 @@ class JunOS < Oxidized::Model post_login 'set cli screen-width 0' pre_logout 'exit' end - end |