Sha256: 3cfe7f8dbdc3d147c932fcf782b04d8674aa58614ae19e870140f590586c9428

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

class MLNXOS < Oxidized::Model
  using Refinements

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

  # Pager Handling
  expect /.+lines\s\d+-\d+([\s]|\/\d+\s\(END\)\s).+$/ do |data, re|
    send ' '
    data.sub re, ''
  end

  cmd :all do |cfg|
    cfg.gsub! /\[\?1h=\r/, '' # Pager Handling
    cfg.gsub! /\[24;1H/, '' # Pager Handling
    cfg.gsub! /\r\[K/, '' # Pager Handling
    cfg.gsub! /\[K/, '' # Pager Handling
    cfg.gsub! /\s/, '' # Linebreak Handling
    cfg.gsub! /^CPU load averages:\s.+/, '' # Omit constantly changing CPU info
    cfg.gsub! /^System memory:\s.+/, '' # Omit constantly changing memory info
    cfg.gsub! /^Uptime:\s.+/, '' # Omit constantly changing uptime info
    cfg.gsub! /.+Generated at\s\d+.+/, '' # Omit constantly changing generation time info
    cfg.lines.to_a[2..-3].join
  end

  cmd :secret do |cfg|
    cfg.gsub! /(snmp-server community).*/, '   <snmp-server community configuration removed>'
    cfg.gsub! /username (\S+) password (\d+) (\S+).*/, '<secret hidden>'
    cfg
  end

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

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

  cmd 'enable'

  cmd 'show running-config' do |cfg|
    cfg
  end

  cfg :ssh do
    password /^Password:\s*/
    pre_logout "\nexit"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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