From ff1a54102606dfc47d7fb33036ccbb3cb2edde2a Mon Sep 17 00:00:00 2001 From: Koen van den Heuvel Date: Sat, 29 Jul 2017 23:55:33 +0200 Subject: Support for Enterasys SecureStack --- lib/oxidized/model/enterasys.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/oxidized/model/enterasys.rb (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/enterasys.rb b/lib/oxidized/model/enterasys.rb new file mode 100644 index 0000000..fb5a501 --- /dev/null +++ b/lib/oxidized/model/enterasys.rb @@ -0,0 +1,25 @@ +class Enterasys < Oxidized::Model + + # Enterasys B3 model # + + prompt /^.+\w\(su\)->\s?$/ + + comment '!' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-2].join + end + + cmd 'show system hardware' do |cfg| + cfg + end + + cmd 'show config' do |cfg| + cfg + end + + cfg :ssh do + pre_logout 'exit' + end + +end -- cgit v1.2.1 From 903cbd16e53b0339aac7a1192b3bd129ce552565 Mon Sep 17 00:00:00 2001 From: Koen van den Heuvel Date: Tue, 1 Aug 2017 12:37:29 +0200 Subject: Update enterasys.rb remove empty and comment lines --- lib/oxidized/model/enterasys.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/oxidized') diff --git a/lib/oxidized/model/enterasys.rb b/lib/oxidized/model/enterasys.rb index fb5a501..708d380 100644 --- a/lib/oxidized/model/enterasys.rb +++ b/lib/oxidized/model/enterasys.rb @@ -1,20 +1,25 @@ class Enterasys < Oxidized::Model - # Enterasys B3 model # + # Enterasys B3/C3 models # prompt /^.+\w\(su\)->\s?$/ comment '!' cmd :all do |cfg| - cfg.each_line.to_a[1..-2].join + cfg.each_line.to_a[2..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n" end cmd 'show system hardware' do |cfg| - cfg + comment cfg end cmd 'show config' do |cfg| + cfg.gsub! /^This command shows non-default configurations only./, '' + cfg.gsub! /^Use 'show config all' to show both default and non-default configurations./, '' + cfg.gsub! /^!|#.*/, '' + cfg.gsub! /^$\n/, '' + cfg end -- cgit v1.2.1