From bc4791b8840f60b7ce3404b1c54d8bc854273d44 Mon Sep 17 00:00:00 2001 From: Ham5ter Date: Wed, 25 May 2016 13:55:55 +0200 Subject: Renames the Class and File to "MLNXOS" The Official Name of the Operating System is "MLNX-OS" I changed the Name to "MLNXOS" because Ruby does not support "-" in Class Names. http://www.mellanox.com/page/mlnx_os --- lib/oxidized/model/mlnxos.rb | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/oxidized/model/mlnxos.rb (limited to 'lib/oxidized/model/mlnxos.rb') diff --git a/lib/oxidized/model/mlnxos.rb b/lib/oxidized/model/mlnxos.rb new file mode 100644 index 0000000..9542c88 --- /dev/null +++ b/lib/oxidized/model/mlnxos.rb @@ -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).*/, ' ' + cfg.gsub! /username (\S+) password (\d+) (\S+).*/, '