summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Parisot <clement.parisot@uni.lu>2017-04-03 09:30:55 +0200
committerClement Parisot <clement.parisot@uni.lu>2017-04-12 13:41:51 +0200
commit58fd5a6ffb386dde320b288f2c428305d5f59986 (patch)
tree80b951a34193018117c3388e7a8860d4e9fd9fe7
parent339bf606b646f127e7f5a4544613cfafeaa28f8a (diff)
Added Mellanox voltaire switch to the list of supported devices
Signed-off-by: Clement Parisot <clement.parisot@uni.lu>
-rw-r--r--README.md1
-rw-r--r--lib/oxidized/model/voltaire.rb56
2 files changed, 57 insertions, 0 deletions
diff --git a/README.md b/README.md
index 5dcd7e0..63f9d81 100644
--- a/README.md
+++ b/README.md
@@ -126,6 +126,7 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* [ScreenOS (Netscreen)](lib/oxidized/model/screenos.rb)
* Mellanox
* [MLNX-OS](lib/oxidized/model/mlnxos.rb)
+ * [Voltaire](lib/oxidized/model/voltaire.rb)
* Mikrotik
* [RouterOS](lib/oxidized/model/routeros.rb)
* Motorola
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).*/, ' <snmp-server community configuration removed>'
+ cfg.gsub! /username (\S+) password (\d+) (\S+).*/, '<secret hidden>'
+ cfg
+ end
+
+
+ cmd 'version show' do |cfg|
+ comment cfg
+ end
+
+ cmd 'firmware-version show' do |cfg|
+ comment cfg
+ end
+
+ cmd 'remote show' do |cfg|
+ cfg
+ end
+
+ cmd 'sm-info show' do |cfg|
+ cfg
+ end
+
+ cmd ' show' do |cfg|
+ cfg
+ end
+
+ cfg :ssh do
+ post_login "no\n"
+ password /^Password:\s*/
+ pre_logout 'exit'
+ end
+end