Sha256: 871feeed9168e7f483d1cb900284d583fe14254f7cf1d67657ef0c4bc544c9c8

Contents?: true

Size: 683 Bytes

Versions: 3

Compression:

Stored size: 683 Bytes

Contents

# model for Centec Networks CNOS based switches
class CNOS < Oxidized::Model
  using Refinements

  comment '! '

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

  cmd 'show running-config' do |cfg|
    cfg.gsub!(/(snmp-server community )(\S+)/, '\1<hidden>')
    cfg.gsub!(/key type private.+key string end/m, '<private key hidden>')
    cfg
  end

  cmd 'show version' do |cfg|
    cfg.gsub! /^(.* uptime is ).*\n/, '\1'
    comment cfg
  end

  cmd 'show transceiver' 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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oxidized-0.30.1 lib/oxidized/model/cnos.rb
oxidized-0.30.0 lib/oxidized/model/cnos.rb
oxidized-0.29.1 lib/oxidized/model/cnos.rb