From 537b28d2652412605b27292be9ff5c1c1c493e76 Mon Sep 17 00:00:00 2001 From: nopedial Date: Sat, 27 Apr 2013 11:06:21 +0100 Subject: Add models and README.md --- lib/oxidized/model/ironware.rb | 32 ++++++++++++++++++++++++++++++++ lib/oxidized/model/powerconnect.rb | 24 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 lib/oxidized/model/ironware.rb create mode 100644 lib/oxidized/model/powerconnect.rb (limited to 'lib/oxidized/model') diff --git a/lib/oxidized/model/ironware.rb b/lib/oxidized/model/ironware.rb new file mode 100644 index 0000000..3dd9ef2 --- /dev/null +++ b/lib/oxidized/model/ironware.rb @@ -0,0 +1,32 @@ +class IronWare < Oxidized::Model + + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-3].join + end + + cmd 'show running-config' do |cfg| + cfg = cfg.each_line.to_a[3..-1].join + cfg + end + + cmd 'show version' do |cfg| + comment cfg + end + + cmd 'show chassis' do |cfg| + comment cfg + end + + cfg :telnet do + username /^Username:/ + password /^Password:/ + end + + cfg :telnet, :ssh do + post_login 'terminal length 0' + pre_logout 'exit' + end + +end diff --git a/lib/oxidized/model/powerconnect.rb b/lib/oxidized/model/powerconnect.rb new file mode 100644 index 0000000..7fa7f2c --- /dev/null +++ b/lib/oxidized/model/powerconnect.rb @@ -0,0 +1,24 @@ +class PowerConnect < Oxidized::Model + + comment '! ' + + cmd :all do |cfg| + cfg.each_line.to_a[1..-3].join + end + + cmd 'show running-config' do |cfg| + cfg = cfg.each_line.to_a[3..-1].join + cfg + end + + cfg :telnet do + username /^User Name:/ + password /^\r?Password:/ + end + + cfg :telnet, :ssh do + post_login 'terminal datadump' + pre_logout 'exit' + end + +end -- cgit v1.2.1