summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-10-25 12:25:19 +0300
committerGitHub <noreply@github.com>2016-10-25 12:25:19 +0300
commit30ca54954dea0e186ddeb066d720743685e8d836 (patch)
tree1b2266af384f61568d92d46a7161c5c9857e4ff7
parentd0857f64f207a84f8e0e19b57baa947c4a6b25af (diff)
parentee48fd9512df8ec839119317f58319a18a398c22 (diff)
Merge pull request #593 from stokbaek/master
Added support for fujitsu blade switches
-rw-r--r--README.md2
-rw-r--r--lib/oxidized/model/fujitsupy.rb42
2 files changed, 44 insertions, 0 deletions
diff --git a/README.md b/README.md
index c348573..1e276e3 100644
--- a/README.md
+++ b/README.md
@@ -106,6 +106,8 @@ Oxidized is a network device configuration backup tool. It's a RANCID replacemen
* [FTOS](lib/oxidized/model/ftos.rb)
* FortiGate
* [FortiOS](lib/oxidized/model/fortios.rb)
+ * Fujitsu
+ * [PRIMERGY Blade switch 1/10Gbe](lib/oxidized/model/fujitsupy.rb)
* HP
* [Comware (HP A-series, H3C, 3Com)](lib/oxidized/model/comware.rb)
* [Procurve](lib/oxidized/model/procurve.rb)
diff --git a/lib/oxidized/model/fujitsupy.rb b/lib/oxidized/model/fujitsupy.rb
new file mode 100644
index 0000000..20a78dd
--- /dev/null
+++ b/lib/oxidized/model/fujitsupy.rb
@@ -0,0 +1,42 @@
+class FujitsuPY < Oxidized::Model
+
+ prompt /^(\([\w.-]*\)\s#|^\S+\#\s)$/
+ comment '! '
+
+ cmd :all do |cfg|
+ cfg.each_line.to_a[1..-2].join
+ end
+
+# 1Gbe switch
+ cmd 'show version' do |cfg|
+ cfg.gsub! /^(<ERROR> : 2 : format error)$/, ''
+ comment cfg
+ end
+
+# 10Gbe switch
+ cmd 'show system information' do |cfg|
+ cfg.gsub! /^Current-time : [\w\s:]*$/, ''
+ cfg.gsub! /^(\s{33}\^)$/, ''
+ cfg.gsub! /^(\% Invalid input detected at '\^' marker.)$/, ''
+ comment cfg
+ end
+
+ cmd 'show running-config' do |cfg|
+ cfg
+ end
+
+ cfg :telnet do
+ username /^Username:/
+ password /^Password:/
+ end
+
+ cfg :telnet, :ssh do
+ post_login 'no pager'
+ post_login 'terminal pager disable'
+ pre_logout do
+ send "quit\n"
+ send "n\n"
+ end
+ end
+
+end