From 58fd5a6ffb386dde320b288f2c428305d5f59986 Mon Sep 17 00:00:00 2001 From: Clement Parisot Date: Mon, 3 Apr 2017 09:30:55 +0200 Subject: Added Mellanox voltaire switch to the list of supported devices Signed-off-by: Clement Parisot --- lib/oxidized/model/voltaire.rb | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lib/oxidized/model/voltaire.rb (limited to 'lib') diff --git a/lib/oxidized/model/voltaire.rb b/lib/oxidized/model/voltaire.rb new file mode 100644 index 0000000..1e7fad2 --- /dev/null +++ b/lib/oxidized/model/voltaire.rb @@ -0,0 +1,56 @@ +class VOLTAIRE < Oxidized::Model + + prompt /([\w.@()-\[:\s\]]+[#>]\s|(One or more tests have failed.*))$/ + 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.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 = cfg.lines.to_a[2..-3].join + end + + cmd :secret do |cfg| + cfg.gsub! /(snmp-server community).*/, ' ' + cfg.gsub! /username (\S+) password (\d+) (\S+).*/, '