summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanilo Sousa <danilopopeye@users.noreply.github.com>2017-08-22 11:19:29 -0300
committerGitHub <noreply@github.com>2017-08-22 11:19:29 -0300
commit328fe9e44f64ce6ef8dcb47068cffb1f233f53cf (patch)
treeb01a1b3e818018135338c02f486633dd50b072d5
parent4042b6907dd5fa07be98c524a0c23f955072652d (diff)
parent7da2df845cd3539f091ffd117028e372daa4f688 (diff)
Merge pull request #952 from koenvdheuvel/patch-1
Create enterasys.rb (C3/B3 series switches)
-rw-r--r--README.md3
-rw-r--r--lib/oxidized/model/enterasys.rb30
2 files changed, 32 insertions, 1 deletions
diff --git a/README.md b/README.md
index 5e0ed8d..fb0a5eb 100644
--- a/README.md
+++ b/README.md
@@ -117,8 +117,9 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* Ericsson/Redback
* [IPOS (former SEOS)](lib/oxidized/model/ipos.rb)
* Extreme Networks
- * [XOS](lib/oxidized/model/xos.rb)
+ * [Enterasys](/lib/oxidized/model/enterasys.rb)
* [WM](lib/oxidized/model/mtrlrfs.rb)
+ * [XOS](lib/oxidized/model/xos.rb)
* F5
* [TMOS](lib/oxidized/model/tmos.rb)
* Force10
diff --git a/lib/oxidized/model/enterasys.rb b/lib/oxidized/model/enterasys.rb
new file mode 100644
index 0000000..708d380
--- /dev/null
+++ b/lib/oxidized/model/enterasys.rb
@@ -0,0 +1,30 @@
+class Enterasys < Oxidized::Model
+
+ # Enterasys B3/C3 models #
+
+ prompt /^.+\w\(su\)->\s?$/
+
+ comment '!'
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[2..-3].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
+ end
+
+ cmd 'show system hardware' do |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
+
+ cfg :ssh do
+ pre_logout 'exit'
+ end
+
+end