Showing with 45 additions and 0 deletions.
  1. +2 −0 README.md
  2. +43 −0 lib/oxidized/model/mlnxos.rb
@@ -101,6 +101,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* Juniper
* JunOS
* ScreenOS (Netscreen)
* Mellanox
* MLNX-OS
* Mikrotik
* RouterOS
* Motorola
@@ -0,0 +1,43 @@
class MLNXOS < Oxidized::Model

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! /\r\[K/,'' # Pager Handling
cfg.gsub! /\s/, '' # Linebreak Handling
cfg = 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 'exit'
end
end