Sha256: cf4cbb213f22c173d1203492c4dc6c43da203fdf8f4f7de746b7e5a9e67d34de

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

class Casa < Oxidized::Model
  # Casa Systems CMTS

  prompt /^([\w.@()-]+[#>]\s?)$/
  comment '! '

  cmd :secret do |cfg|
    cfg.gsub! /^(snmp community) \S+/, '\\1 <configuration removed>'
    cfg.gsub! /^(snmp comm-tbl) \S+ \S+/, '\\1 <removed> <removed>'
    cfg.gsub! /^(console-password encrypted) \S+/, '\\1 <secret hidden>'
    cfg.gsub! /^(password encrypted) \S+/, '\\1 <secret hidden>'
    cfg.gsub! /^(tacacs-server key) \S+/, '\\1 <secret hidden>'
    cfg
  end

  cmd :all do |cfg|
    cfg.each_line.to_a[1..-2].join
  end

  cmd 'show system' do |cfg|
    comment cfg.each_line.reject { |line| line.match /^\s+System (Time|Uptime): / }.join
  end

  cmd 'show version' do |cfg|
    comment cfg
  end

  cmd 'show run'

  cfg :telnet do
    username /^Username:/
    password /^Password:/
  end

  cfg :telnet, :ssh do
    post_login 'page-off'
    # preferred way to handle additional passwords
    if vars :enable
      post_login do
        send "enable\n"
        cmd vars(:enable)
      end
    end
    pre_logout 'logout'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
oxidized-0.24.0 lib/oxidized/model/casa.rb
oxidized-0.23.0 lib/oxidized/model/casa.rb
oxidized-0.22.0 lib/oxidized/model/casa.rb
oxidized-0.21.0 lib/oxidized/model/casa.rb
oxidized-0.20.0 lib/oxidized/model/casa.rb
oxidized-0.19.0 lib/oxidized/model/casa.rb