Sha256: 374c77dce3518b3201e6e906d8aa96b73db2a32a46919468cdde9072fa7769b7

Contents?: true

Size: 759 Bytes

Versions: 2

Compression:

Stored size: 759 Bytes

Contents

class Dlink < Oxidized::Model
  # D-LINK Switches

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

  cmd :secret do |cfg|
    cfg.gsub! /^(create snmp community) \S+/, '\\1 <removed>'
    cfg.gsub! /^(create snmp group) \S+/, '\\1 <removed>'
    cfg
  end

  cmd :all do |cfg|
    cfg.each_line.to_a[2..-2].map { |line| line.delete("\r").rstrip }.join("\n") + "\n"
  end

  cmd 'show switch' do |cfg|
    cfg.gsub! /^System\ Uptime\s.+/, '' # Omit constantly changing uptime info
    comment cfg
  end

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

  cmd 'show config current'

  cfg :telnet do
    username /\r*username:/
    password /\r*password:/
  end

  cfg :telnet, :ssh do
    post_login 'disable clipaging'
    pre_logout 'logout'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oxidized-0.23.0 lib/oxidized/model/dlink.rb
oxidized-0.22.0 lib/oxidized/model/dlink.rb