diff options
author | Matthias Cramer <matthias.cramer@iway.ch> | 2017-06-16 11:52:47 +0200 |
---|---|---|
committer | Matthias Cramer <matthias.cramer@iway.ch> | 2017-06-16 11:52:47 +0200 |
commit | b7569965d1ec6112d0cd588ebd0b13a541bb6ef7 (patch) | |
tree | fbf410ebdfc268e55df73571fc85c426e8b25dbf /lib/oxidized/model/voltaire.rb | |
parent | bb06ac367daeed2f11682b8ef6e1182923570b42 (diff) | |
parent | dc425ce5bc3143cf4b8322602d7b7521aca37134 (diff) |
Merge branch 'master' of https://github.com/ytti/oxidized
Diffstat (limited to 'lib/oxidized/model/voltaire.rb')
-rw-r--r-- | lib/oxidized/model/voltaire.rb | 56 |
1 files changed, 56 insertions, 0 deletions
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 |